diff options
Diffstat (limited to 'testsuite/fail_compilation')
4 files changed, 48 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/assign_void_call.elna b/testsuite/fail_compilation/assign_void_call.elna new file mode 100644 index 0000000..d18b1c8 --- /dev/null +++ b/testsuite/fail_compilation/assign_void_call.elna @@ -0,0 +1,9 @@ +var + x: Int + +proc v() +return + +begin + x := v() (* @Error Expected type 'Int', but the expression has no value *) +end. diff --git a/testsuite/fail_compilation/compare_unrelated_records.elna b/testsuite/fail_compilation/compare_unrelated_records.elna new file mode 100644 index 0000000..71eaeda --- /dev/null +++ b/testsuite/fail_compilation/compare_unrelated_records.elna @@ -0,0 +1,17 @@ +type + A = record + x: Int + end + B = record + y: Int; + z: Int + end + +var + a: A + b: B + ok: Bool + +begin + ok := b = a (* @Error Invalid operands of type 'B' and 'A' for operator = *) +end. diff --git a/testsuite/fail_compilation/proc_type_without_parameters.elna b/testsuite/fail_compilation/proc_type_without_parameters.elna new file mode 100644 index 0000000..92514f6 --- /dev/null +++ b/testsuite/fail_compilation/proc_type_without_parameters.elna @@ -0,0 +1,9 @@ +var + x: Int + +proc f() +return + +begin + x := f (* @Error Expected type 'Int', but got 'proc\(\)' *) +end. diff --git a/testsuite/fail_compilation/record-base-cycle-indirect.elna b/testsuite/fail_compilation/record-base-cycle-indirect.elna new file mode 100644 index 0000000..412e6ea --- /dev/null +++ b/testsuite/fail_compilation/record-base-cycle-indirect.elna @@ -0,0 +1,13 @@ +type + A = record(B) + x: Int + end + B = record(A) (* @Error Type declaration forms a cycle: A -> B -> A *) + y: Int + end + +var + v: A + +begin +end. |
