From 0f5e9f00b07606871a6289060fa904555d41ae7d Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 31 Aug 2026 17:18:39 +0200 Subject: Reject comparison of uncompatible types --- .../fail_compilation/compare_unrelated_records.elna | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 testsuite/fail_compilation/compare_unrelated_records.elna (limited to 'testsuite/fail_compilation/compare_unrelated_records.elna') 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. -- cgit v1.2.3