From 36a274c9a8bca944234589220def025d3920b3ef Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 28 Jul 2026 19:19:32 +0200 Subject: Enforce case label uniqueness and constness --- testsuite/fail_compilation/case_non_constant.elna | 2 +- testsuite/fail_compilation/case_unique_label.elna | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 testsuite/fail_compilation/case_unique_label.elna (limited to 'testsuite') diff --git a/testsuite/fail_compilation/case_non_constant.elna b/testsuite/fail_compilation/case_non_constant.elna index 2f19df8..dc69703 100644 --- a/testsuite/fail_compilation/case_non_constant.elna +++ b/testsuite/fail_compilation/case_non_constant.elna @@ -11,6 +11,6 @@ var begin x := r; case x of - r: (* @Error Expected a constant expression *) + r: (* @Error Case label must be a constant expression *) end end. diff --git a/testsuite/fail_compilation/case_unique_label.elna b/testsuite/fail_compilation/case_unique_label.elna new file mode 100644 index 0000000..a97fb37 --- /dev/null +++ b/testsuite/fail_compilation/case_unique_label.elna @@ -0,0 +1,7 @@ +begin + case 3 of + 1: + | 3: + | 1 + 2: (* @Error Duplicate case label *) + end +end. -- cgit v1.2.3