From 62122cf7432d01f7e7da3eca96aca991635f6d80 Mon Sep 17 00:00:00 2001 From: paulklint Date: Tue, 25 Aug 2026 10:10:21 +0200 Subject: [PATCH 1/2] Add failing tests for #2867 --- .../check/tests/DataDeclarationTCTests.rsc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc index 2271b724e36..6fc8333339d 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc @@ -565,4 +565,19 @@ test bool fieldSelectionFromDestructuringAssignment(){ // ht @toinehartman return tm.kwArg; // Potential error: Unresolved type for useViaType `kwArg` in |file:.....| }"); -} \ No newline at end of file +} + +test bool issue2867() = checkModuleOK(" + module FalsePositive /**/ + data D[&T] = d(&T n); + int f() { + n1 = d(5).n; + n2 = n1; + n3 = n2; + return n3 + 5; + } + "); + +// Identical to test `issue2867`, but on a single line to make sure it fails on +// both Windows and Linux (force `\n` instead `\r\n`) +test bool issue2867Oneline() = checkModuleOK("module FalsePositive /**/\ndata D[&T] = d(&T n);\nint f() {\nn1 = d(5).n;\nn2 = n1;\nn3 = n2;\nreturn n3 + 5;}"); From 27735b024964e7768ba465ef2ba4c24fd0788ca3 Mon Sep 17 00:00:00 2001 From: Sung-Shik Jongmans Date: Wed, 26 Aug 2026 11:40:34 +0200 Subject: [PATCH 2/2] Add space to trigger different order of calcs/reqs in tests --- .../lang/rascalcore/check/tests/DataDeclarationTCTests.rsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc index 6fc8333339d..d630739b6cf 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc @@ -568,7 +568,7 @@ test bool fieldSelectionFromDestructuringAssignment(){ // ht @toinehartman } test bool issue2867() = checkModuleOK(" - module FalsePositive /**/ + module FalsePositive /**/ data D[&T] = d(&T n); int f() { n1 = d(5).n; @@ -580,4 +580,4 @@ test bool issue2867() = checkModuleOK(" // Identical to test `issue2867`, but on a single line to make sure it fails on // both Windows and Linux (force `\n` instead `\r\n`) -test bool issue2867Oneline() = checkModuleOK("module FalsePositive /**/\ndata D[&T] = d(&T n);\nint f() {\nn1 = d(5).n;\nn2 = n1;\nn3 = n2;\nreturn n3 + 5;}"); +test bool issue2867Oneline() = checkModuleOK("module FalsePositive /**/\ndata D[&T] = d(&T n);\nint f() {\nn1 = d(5).n;\nn2 = n1;\nn3 = n2;\nreturn n3 + 5;}");