From cdbc1695a93910df5729779de31912a3b4b4172b Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 19 Jul 2026 17:09:40 +0200 Subject: Support unary plus operation --- testsuite/fail_compilation/unary_minus_on_record.elna | 9 +++++++++ testsuite/fail_compilation/unary_negation_on_record.elna | 9 +++++++++ testsuite/fail_compilation/unary_plus_on_record.elna | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 testsuite/fail_compilation/unary_minus_on_record.elna create mode 100644 testsuite/fail_compilation/unary_negation_on_record.elna create mode 100644 testsuite/fail_compilation/unary_plus_on_record.elna (limited to 'testsuite/fail_compilation') diff --git a/testsuite/fail_compilation/unary_minus_on_record.elna b/testsuite/fail_compilation/unary_minus_on_record.elna new file mode 100644 index 0000000..cfd76a2 --- /dev/null +++ b/testsuite/fail_compilation/unary_minus_on_record.elna @@ -0,0 +1,9 @@ +type + R = record + x: Int + end + +proc f(r: R): Int +return -r (* @Error Type 'R' cannot be used with unary '-' *) + +end. diff --git a/testsuite/fail_compilation/unary_negation_on_record.elna b/testsuite/fail_compilation/unary_negation_on_record.elna new file mode 100644 index 0000000..370f04d --- /dev/null +++ b/testsuite/fail_compilation/unary_negation_on_record.elna @@ -0,0 +1,9 @@ +type + R = record + x: Int + end + +proc f(r: R): Int +return ~r (* @Error Type 'R' cannot be used with unary '~' *) + +end. diff --git a/testsuite/fail_compilation/unary_plus_on_record.elna b/testsuite/fail_compilation/unary_plus_on_record.elna new file mode 100644 index 0000000..7289873 --- /dev/null +++ b/testsuite/fail_compilation/unary_plus_on_record.elna @@ -0,0 +1,9 @@ +type + R = record + x: Int + end + +proc f(r: R): Int +return +r (* @Error Type 'R' cannot be used with unary '\+' *) + +end. -- cgit v1.2.3