diff options
Diffstat (limited to 'testsuite/fail_compilation')
| -rw-r--r-- | testsuite/fail_compilation/case_non_constant.elna | 16 | ||||
| -rw-r--r-- | testsuite/fail_compilation/case_type_mismatch.elna | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/case_non_constant.elna b/testsuite/fail_compilation/case_non_constant.elna new file mode 100644 index 0000000..2f19df8 --- /dev/null +++ b/testsuite/fail_compilation/case_non_constant.elna @@ -0,0 +1,16 @@ +type + R = record + a: Int; + b: Int + end + +var + r: R + x: R + +begin + x := r; + case x of + r: (* @Error Expected a constant expression *) + end +end. diff --git a/testsuite/fail_compilation/case_type_mismatch.elna b/testsuite/fail_compilation/case_type_mismatch.elna new file mode 100644 index 0000000..9cdae38 --- /dev/null +++ b/testsuite/fail_compilation/case_type_mismatch.elna @@ -0,0 +1,9 @@ +var + x: Int + +begin + case x of + 1: (* ok *) + | true: (* @Error Invalid operands of type 'Int' and 'Bool' for operator = *) + end +end. |
