X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FEApply.java;h=5d915a98dce93b2ac88e2476effaed460e2d25ba;hb=5f273ad00996eee1478b718b9847b7f9db5a2b86;hp=d45e7fc8c4a6ee2917b2c55cabdfadc7a52e5f9e;hpb=ff1337ff96700fb157ec789cbef88b8f40e03798;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EApply.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EApply.java index d45e7fc8c..5d915a98d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EApply.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EApply.java @@ -32,10 +32,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 EApply extends Expression { public Expression function; public Expression[] parameters; @@ -75,15 +71,9 @@ public class EApply extends Expression { public Expression[] getParameters() { return parameters; } - - public void collectVars(TObjectIntHashMap allVars, TIntHashSet vars) { - function.collectVars(allVars, vars); - for(Expression parameter : parameters) - parameter.collectVars(allVars, vars); - } - - @Override - protected void updateType() throws MatchException { + + @Override + protected void updateType() throws MatchException { MultiFunction mfun = Types.matchFunction(function.getType(), parameters.length); /*for(int i=0;i vars) { - function.collectFreeVariables(vars); - for(Expression parameter : parameters) - parameter.collectFreeVariables(vars); - } private void combineApplications() { if(function instanceof EApply) { @@ -186,13 +169,6 @@ public class EApply extends Expression { for(Expression parameter : this.parameters) parameters.add(parameter); } - - @Override - public void removeFreeVariables(THashSet vars) { - function.removeFreeVariables(vars); - for(Expression parameter : parameters) - parameter.removeFreeVariables(vars); - } @Override public Expression replace(ReplaceContext context) { @@ -289,7 +265,7 @@ public class EApply extends Expression { @Override public Expression checkIgnoredType(TypingContext context) { if(parameters.length == 2 && function instanceof EConstant && ((EConstant)function).value.getName() == Names.Prelude_dollar) - return new EApply(location, parameters[0], parameters[1]).inferType(context); + return new EApply(location, parameters[0], parameters[1]).checkIgnoredType(context); inferType(context, true); if(Types.canonical(getType()) != Types.UNIT) return new ESimpleLet(location, null, this, new ELiteral(NoRepConstant.PUNIT));