X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FESimpleLambda.java;h=13c75db78bed5fe0f24cb211009ffb7c04f61b80;hp=9b3ee8df77bcdb7812f8ef3f8472cbe83bf34bec;hb=6dfe20b0f514b91337fcac4de0267ffd8268be07;hpb=ff1337ff96700fb157ec789cbef88b8f40e03798 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java index 9b3ee8df7..13c75db78 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ESimpleLambda.java @@ -1,6 +1,7 @@ package org.simantics.scl.compiler.elaboration.expressions; import java.util.ArrayList; +import java.util.Set; import org.simantics.scl.compiler.common.exceptions.InternalCompilerError; import org.simantics.scl.compiler.compilation.CompilationContext; @@ -23,7 +24,6 @@ import org.simantics.scl.compiler.types.kinds.Kinds; import org.simantics.scl.compiler.types.util.MultiFunction; import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; import gnu.trove.set.hash.TIntHashSet; public class ESimpleLambda extends Expression { @@ -66,21 +66,15 @@ public class ESimpleLambda extends Expression { return this; } - @Override - protected void updateType() throws MatchException { - setType(Types.functionE(Types.canonical(parameter.type), - effect, value.getType())); - } - - @Override - public IVal toVal(CompilationContext context, CodeWriter w) { - return lambdaToVal(context, w); + @Override + protected void updateType() throws MatchException { + setType(Types.functionE(Types.canonical(parameter.type), + effect, value.getType())); } @Override - public void collectFreeVariables(THashSet vars) { - value.collectFreeVariables(vars); - vars.remove(parameter); + public IVal toVal(CompilationContext context, CodeWriter w) { + return lambdaToVal(context, w); } @Override @@ -143,7 +137,7 @@ public class ESimpleLambda extends Expression { // Free variables; ExpressionInterpretationContext innerContext = context.createNewContext(); - THashSet freeVariables = cur.getFreeVariables(); + Set freeVariables = cur.getFreeVariables(); for(Variable parameter : parameters) freeVariables.remove(parameter); int i=0;