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%2Finternal%2Felaboration%2Fdecomposed%2FDecomposedExpression.java;h=64e859253d39e16cbe62282b7f39355dd4f0553f;hp=0ad3096b237a9c0d3279af6295f87f7b9c15f2a7;hb=862c09c9608329f326404342d12da61792eece2c;hpb=695ffae899b981f31695e5fdd30ac8fed9fe84b8 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/elaboration/decomposed/DecomposedExpression.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/elaboration/decomposed/DecomposedExpression.java index 0ad3096b2..64e859253 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/elaboration/decomposed/DecomposedExpression.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/elaboration/decomposed/DecomposedExpression.java @@ -7,6 +7,7 @@ import org.simantics.scl.compiler.elaboration.expressions.ELambdaType; import org.simantics.scl.compiler.elaboration.expressions.ESimpleLambda; import org.simantics.scl.compiler.elaboration.expressions.Expression; import org.simantics.scl.compiler.elaboration.expressions.Variable; +import org.simantics.scl.compiler.errors.ErrorLog; import org.simantics.scl.compiler.top.SCLCompilerConfiguration; import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; @@ -34,7 +35,7 @@ public class DecomposedExpression { this.body = body; } - public static DecomposedExpression decompose(Expression expression) { + public static DecomposedExpression decompose(ErrorLog errorLog, Expression expression) { ArrayList typeParameterList = new ArrayList(); ArrayList parameterList = new ArrayList(); Type effect = Types.NO_EFFECTS; @@ -42,9 +43,9 @@ public class DecomposedExpression { if(expression instanceof ESimpleLambda) { ESimpleLambda lambda = (ESimpleLambda)expression; parameterList.add(lambda.parameter); - expression = lambda.value; if(Types.canonical(effect) != Types.NO_EFFECTS) - throw new InternalCompilerError(); + errorLog.logWarning(expression.location, "Encountered nested lambdas where outermost lambda contains effects. The reason is probably in the subsumption solver and code should be OK."); + expression = lambda.value; effect = Types.simplifyFinalEffect(lambda.getLocalEffect()); } else if(expression instanceof ELambdaType) {