From 7ec5d2e4008e0bd5bf5b9c808825f1d6cb487269 Mon Sep 17 00:00:00 2001 From: Sascha Lisson Date: Mon, 24 Aug 2026 11:28:09 +0200 Subject: [PATCH 1/3] Fix NullPointerException in RecordValue.equals Comparing member values used Object.equals, which throws when a member is present but mapped to null. Use the null-safe :ne: operator instead. Co-Authored-By: Claude Opus 5 --- .../org/iets3/core/expr/toplevel/plugin.mps | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps index 54c8724587..00c5a40f15 100644 --- a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps +++ b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps @@ -127,6 +127,7 @@ + @@ -822,34 +823,29 @@ - - - - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + From 030cab47bbf5e3315ce7d0a7d483179f723fc0a3 Mon Sep 17 00:00:00 2001 From: Sascha Lisson Date: Mon, 24 Aug 2026 11:30:33 +0200 Subject: [PATCH 2/3] Align RecordValue.equals with hashCode hashCode hashed memberData and recordDeclaration, while equals compared only memberData, so two record values with equal members but different record declarations were equal with differing hash codes. Compare the record declaration in equals as well. Co-Authored-By: Claude Opus 5 --- .../org/iets3/core/expr/toplevel/plugin.mps | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps index 00c5a40f15..b8987ed8cf 100644 --- a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps +++ b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps @@ -744,6 +744,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 934b968f9254ea9b2c04e8e845f2dab9518ce291 Mon Sep 17 00:00:00 2001 From: Sascha Lisson Date: Mon, 24 Aug 2026 11:50:19 +0200 Subject: [PATCH 3/3] Fix RecordValue.compareTo for inline records and null member values compareTo threw a NullPointerException for a record value without a record declaration -- what the interpreter builds for inline records -- because effectiveMembers() returns null for a null node. Such a record now compares by member name instead. Member values that were null were skipped entirely, which made the ordering intransitive: {y:1} vs {y:null} and {y:null} vs {y:2} both compared equal while {y:1} vs {y:2} did not, so a TreeSet of the three held two elements. A member without a value now sorts before one that has a value. Adds test cases for both, plus a regression test for the equals() NullPointerException fixed in 7ec5d2e400. Co-Authored-By: Claude Opus 5 --- .../org/iets3/core/expr/toplevel/plugin.mps | 588 +++++++++----- .../models/test.ts.expr.os.records@tests.mps | 756 ++++++++++++++++++ 2 files changed, 1161 insertions(+), 183 deletions(-) diff --git a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps index b8987ed8cf..65b34e414e 100644 --- a/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps +++ b/code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/plugin.mps @@ -146,11 +146,11 @@ - + @@ -172,6 +172,10 @@ + + + + @@ -354,6 +358,10 @@ + + + + @@ -1102,143 +1110,159 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + - - - - - + + + + - - - - - - + + + + + - - - - - + + - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + - + @@ -1246,91 +1270,49 @@ - - - - + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - + + + + - @@ -1358,6 +1340,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1369,6 +1449,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/languages/org.iets3.opensource/tests/test.ts.expr.os/models/test.ts.expr.os.records@tests.mps b/code/languages/org.iets3.opensource/tests/test.ts.expr.os/models/test.ts.expr.os.records@tests.mps index 70d1225e87..369fdd2f80 100644 --- a/code/languages/org.iets3.opensource/tests/test.ts.expr.os/models/test.ts.expr.os.records@tests.mps +++ b/code/languages/org.iets3.opensource/tests/test.ts.expr.os/models/test.ts.expr.os.records@tests.mps @@ -9,6 +9,7 @@ + @@ -49,9 +50,13 @@ + + + + @@ -63,6 +68,7 @@ + @@ -77,6 +83,8 @@ + + @@ -85,6 +93,13 @@ + + + + + + + @@ -142,6 +157,12 @@ + + + + + + @@ -151,6 +172,14 @@ + + + + + + + + @@ -484,6 +513,733 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +