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%2FELambdaType.java;h=73e38397da334145d852cd26fdc41d2f447c773e;hp=d413b8c35ecd4d9767ed1f649d636ca36dfdb174;hb=666ee533a3cfa9f59e79215a269f8342227cdbda;hpb=2f63e7a58e49a233b28c6968b848281060117c43 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambdaType.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambdaType.java index d413b8c35..73e38397d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambdaType.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambdaType.java @@ -12,14 +12,9 @@ import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; import org.simantics.scl.compiler.internal.interpreted.IExpression; import org.simantics.scl.compiler.top.ExpressionInterpretationContext; import org.simantics.scl.compiler.types.TVar; -import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.exceptions.MatchException; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; -import gnu.trove.set.hash.TIntHashSet; - public class ELambdaType extends Expression { public TVar[] parameters; public Expression value; @@ -30,31 +25,16 @@ public class ELambdaType extends Expression { this.value = value; } - public void collectRefs(TObjectIntHashMap allRefs, TIntHashSet refs) { - value.collectRefs(allRefs, refs); + @Override + protected void updateType() throws MatchException { + setType(Types.forAll(parameters, value.getType())); } - - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - value.collectVars(allVars, vars); - } - - @Override - protected void updateType() throws MatchException { - setType(Types.forAll(parameters, value.getType())); - } - @Override + @Override public IVal toVal(CompilationContext context, CodeWriter w) { return lambdaToVal(context, w); } - @Override - public void collectFreeVariables(THashSet vars) { - value.collectFreeVariables(vars); - } - @Override public Expression simplify(SimplificationContext context) { value = value.simplify(context); @@ -91,10 +71,6 @@ public class ELambdaType extends Expression { public Expression inferType(TypingContext context) { throw new InternalCompilerError("Should not type check " + getClass().getSimpleName() + "."); } - - @Override - public void collectEffects(THashSet effects) { - } @Override public void setLocationDeep(long loc) {