]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
(refs #7614) Assign type-checked expression back to list comprehension 16/1216/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 13 Nov 2017 10:49:14 +0000 (12:49 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 13 Nov 2017 10:49:14 +0000 (12:49 +0200)
Change-Id: Id964cb53d85b0a8e5ec95f472d1f9afe7dc45160

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListAssignment.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGenerator.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/list/ListGuard.java

index cddcffc77bdedb7f95f9896c3f223f0a1d2b94e4..c4fad0039b9cc3ce815ffae2509f2698146db729 100644 (file)
@@ -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
index e0401e6dcc0cad39c9b822b21bee82ea411980e7..67076789e5272368a14e5f386aeb93bf690f4821 100644 (file)
@@ -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
index e5e8ee9d47cdca494a9224a088519426fe684f81..dfa618ad485387443226f43000823c1ee8d565f6 100644 (file)
@@ -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