diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-28 19:19:32 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-28 19:19:32 +0200 |
| commit | 36a274c9a8bca944234589220def025d3920b3ef (patch) | |
| tree | f198ad272b74ffa3abb13e5063b55514d521e1f6 /testsuite/fail_compilation | |
| parent | 5cdaceb77af6a1d98145f8afb34ce6884e21a3d6 (diff) | |
| download | elna-36a274c9a8bca944234589220def025d3920b3ef.tar.gz | |
Enforce case label uniqueness and constness
Diffstat (limited to 'testsuite/fail_compilation')
| -rw-r--r-- | testsuite/fail_compilation/case_non_constant.elna | 2 | ||||
| -rw-r--r-- | testsuite/fail_compilation/case_unique_label.elna | 7 |
2 files changed, 8 insertions, 1 deletions
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. |
