]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EApplyType.java
(refs #7375) Replace collectRefs by CollectRefsVisitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EApplyType.java
index d07b6d13bc17d6f6702c2ca7050f9e0916c69272..f441a1be5880254123eb7be77a1e116a31decbae 100644 (file)
@@ -9,7 +9,6 @@ import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.codegen.references.IVal;
 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
-import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
 import org.simantics.scl.compiler.internal.interpreted.IExpression;
 import org.simantics.scl.compiler.top.ExpressionInterpretationContext;
 import org.simantics.scl.compiler.types.Type;
@@ -51,21 +50,17 @@ public class EApplyType extends Expression {
         return parameter;
     }
 
-       public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
-        expression.collectRefs(allRefs, refs);
+    public void collectVars(TObjectIntHashMap<Variable> allVars, TIntHashSet vars) {
+        expression.collectVars(allVars, vars);
     }
-       
-       public void collectVars(TObjectIntHashMap<Variable> allVars, TIntHashSet vars) {
-           expression.collectVars(allVars, vars);
-       }
 
-       @Override
-       protected void updateType() throws MatchException {
-           setType(Types.instantiate(expression.getType(), parameter));
-       }
-       
-       @Override
-       public IVal toVal(CompilationContext context, CodeWriter w) {
+    @Override
+    protected void updateType() throws MatchException {
+        setType(Types.instantiate(expression.getType(), parameter));
+    }
+
+    @Override
+    public IVal toVal(CompilationContext context, CodeWriter w) {
         IVal val = expression.toVal(context, w);
         return val.createSpecialization(parameter);
     }
@@ -111,12 +106,6 @@ public class EApplyType extends Expression {
     public Expression inferType(TypingContext context) {
         throw new InternalCompilerError("Should not type check " + getClass().getSimpleName() + ".");
     }
-
-    @Override
-    public Expression decorate(ExpressionDecorator decorator) {
-        expression = expression.decorate(decorator);
-        return decorator.decorate(this);
-    }
     
     @Override
     public boolean isEffectful() {
@@ -140,11 +129,6 @@ public class EApplyType extends Expression {
     public void accept(ExpressionVisitor visitor) {
         visitor.visit(this);
     }
-
-    @Override
-    public void forVariables(VariableProcedure procedure) {
-        expression.forVariables(procedure);
-    }
     
     @Override
     public Expression accept(ExpressionTransformer transformer) {