From: Hannu Niemistö Date: Mon, 13 Nov 2017 10:49:14 +0000 (+0200) Subject: (refs #7614) Assign type-checked expression back to list comprehension X-Git-Tag: v1.31.0~44^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=a04614760395f09f5e9e3d38226b72f1b8e3d7ba;p=simantics%2Fplatform.git (refs #7614) Assign type-checked expression back to list comprehension Change-Id: Id964cb53d85b0a8e5ec95f472d1f9afe7dc45160 --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListAssignment.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListAssignment.java index cddcffc77..c4fad0039 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListAssignment.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListAssignment.java @@ -23,7 +23,7 @@ public class ListAssignment extends ListQualifier { @Override public void checkType(TypingContext context) { value = value.inferType(context); - pattern.checkTypeAsPattern(context, value.getType()); + pattern = pattern.checkTypeAsPattern(context, value.getType()); } @Override diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGenerator.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGenerator.java index e0401e6dc..67076789e 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGenerator.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGenerator.java @@ -26,8 +26,8 @@ public class ListGenerator extends ListQualifier { @Override public void checkType(TypingContext context) { TMetaVar componentType = Types.metaVar(Kinds.STAR); - value.checkType(context, Types.apply(Types.LIST, componentType)); - pattern.checkTypeAsPattern(context, componentType); + value = value.checkType(context, Types.apply(Types.LIST, componentType)); + pattern = pattern.checkTypeAsPattern(context, componentType); } @Override diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGuard.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGuard.java index e5e8ee9d4..dfa618ad4 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGuard.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGuard.java @@ -16,7 +16,7 @@ public class ListGuard extends ListQualifier { @Override public void checkType(TypingContext context) { - condition.checkType(context, Types.BOOLEAN); + condition = condition.checkType(context, Types.BOOLEAN); } @Override