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%2Felaboration%2Fexpressions%2FEBind.java;fp=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FEBind.java;h=5664db7bfdd768f17dbbda87c45a5c6abb8ae995;hp=c72776b35829ea91b6aa90037b4920bf35c39458;hb=2148e9b3fecb3385ac71f302eea7045cf370afe2;hpb=f9414daee0c65900deb73ab81a2d7f157c6bd5e4 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBind.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBind.java index c72776b35..5664db7bf 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBind.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBind.java @@ -89,10 +89,6 @@ public class EBind extends SimplifiableExpression { */ @Override public Expression simplify(SimplificationContext context) { - value = value.simplify(context); - in = in.simplify(context); - pattern = pattern.simplify(context); - long loc = getLocation(); monadType = Types.canonical(monadType); valueContentType = Types.canonical(valueContentType); @@ -101,11 +97,11 @@ public class EBind extends SimplifiableExpression { Type[] types = blockType == BlockType.MonadE ? new Type[] {monadType, valueContentType, effect, inContentType} : new Type[] {monadType, valueContentType, inContentType}; - Expression simplified = new EApply(loc, + Expression simplified = new EApply(loc, effect, new EConstant(loc, context.getValue(blockType == BlockType.MonadE ? Names.Prelude_bindE : Names.Prelude_bind), types), monadEvidence, value, - new ELambda(loc, new Case[] { + new ELambda(loc, effect, new Case[] { new Case(new Expression[] { pattern }, in) })); simplified.setType(getType());