]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambdaType.java
(refs #7375) Replaced collectVars method by a visitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ELambdaType.java
index 34464fae41a7e7986fd88e72d5916cf4a089839e..73e38397da334145d852cd26fdc41d2f447c773e 100644 (file)
@@ -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<Object> allRefs, TIntHashSet refs) {
-        value.collectRefs(allRefs, refs);
+    @Override
+    protected void updateType() throws MatchException {
+        setType(Types.forAll(parameters, value.getType()));
     }
-       
-       @Override
-       public void collectVars(TObjectIntHashMap<Variable> 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<Variable> 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<Type> effects) {
-    }
     
     @Override
     public void setLocationDeep(long loc) {
@@ -108,11 +84,6 @@ public class ELambdaType extends Expression {
     public void accept(ExpressionVisitor visitor) {
         visitor.visit(this);
     }
-
-    @Override
-    public void forVariables(VariableProcedure procedure) {
-        value.forVariables(procedure);
-    }
     
     @Override
     public Expression accept(ExpressionTransformer transformer) {