]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELambda.java
Merge "(refs #7508) Added missing effects in the simplification of EBind"
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ELambda.java
index 51b1f909e34624e164cb528ec9680d35854132ab..b01b771894a831b16d193d208317b746eede221e 100644 (file)
@@ -12,10 +12,6 @@ import org.simantics.scl.compiler.types.exceptions.UnificationException;
 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 ELambda extends SimplifiableExpression {
     public Case[] cases;
     Type effect = Types.NO_EFFECTS;
@@ -33,17 +29,16 @@ public class ELambda extends SimplifiableExpression {
         this.cases = cases;
     }
     
+    public ELambda(long loc, Type effect, Case ... cases) {
+        super(loc);
+        this.cases = cases;
+        this.effect = effect;
+    }
+    
     public ELambda(long loc, Expression pat, Expression exp) {
         this(loc, new Case(new Expression[] {pat}, exp));
     }
 
-    @Override
-    public void collectVars(TObjectIntHashMap<Variable> allVars,
-            TIntHashSet vars) {
-        for(Case case_ : cases)
-            case_.collectVars(allVars, vars);
-    }
-
     public Expression decomposeMatching() {
         Expression[] patterns = cases[0].patterns;
         int arity = patterns.length;
@@ -98,12 +93,6 @@ public class ELambda extends SimplifiableExpression {
            return decomposeMatching().simplify(context);
        }
 
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        for(Case case_ : cases)
-            case_.collectFreeVariables(vars);
-    }
-
     @Override
     public Expression resolve(TranslationContext context) {
         for(Case case_ : cases)
@@ -172,15 +161,6 @@ public class ELambda extends SimplifiableExpression {
     public boolean isEffectful() {
        return false;
     }
-
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-        for(Case case_ : cases) {
-            for(Expression pattern : case_.patterns)
-                pattern.collectEffects(effects);
-            case_.value.collectEffects(effects);
-        }
-    }
     
     @Override
     public void accept(ExpressionVisitor visitor) {