From a04614760395f09f5e9e3d38226b72f1b8e3d7ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Mon, 13 Nov 2017 12:49:14 +0200 Subject: [PATCH] (refs #7614) Assign type-checked expression back to list comprehension Change-Id: Id964cb53d85b0a8e5ec95f472d1f9afe7dc45160 --- .../compiler/elaboration/expressions/list/ListAssignment.java | 2 +- .../compiler/elaboration/expressions/list/ListGenerator.java | 4 ++-- .../scl/compiler/elaboration/expressions/list/ListGuard.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.47.1