From 13dfd7fe98a33fd04e88e9da76e102efc72d9255 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 11 Apr 2017 00:27:16 +0300 Subject: [PATCH] Accept existential variables as record shorthand fields Change-Id: I2d4ca35f26ba80795696b357f81d778420f40d51 --- .../scl/compiler/elaboration/expressions/ERecord.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java index 6ef9e9e72..a41c0f042 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERecord.java @@ -54,11 +54,14 @@ public class ERecord extends ASTExpression { THashMap recordMap = new THashMap(fields.length); for(FieldAssignment field : fields) { if(field.value == null) { + String actualName = field.name; + if(actualName.charAt(0) == '?') + actualName = actualName.substring(1); String bestMatch = null; int bestMatchLength = 0; for(int i=0;i bestMatchLength) { + if(actualName.startsWith(fieldName) && fieldName.length() > bestMatchLength) { bestMatch = fieldName; bestMatchLength = fieldName.length(); } -- 2.47.1