From d4681529c20d5cb2630bfe09f4cf4c4ca4c98a23 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 18 Nov 2026 00:10:23 +0100 Subject: Restrict pointer subtraction by type --- testsuite/fail_compilation/pointer_subtraction_mismatch.elna | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 testsuite/fail_compilation/pointer_subtraction_mismatch.elna (limited to 'testsuite/fail_compilation/pointer_subtraction_mismatch.elna') diff --git a/testsuite/fail_compilation/pointer_subtraction_mismatch.elna b/testsuite/fail_compilation/pointer_subtraction_mismatch.elna new file mode 100644 index 0000000..5ad1dcb --- /dev/null +++ b/testsuite/fail_compilation/pointer_subtraction_mismatch.elna @@ -0,0 +1,10 @@ +program() + +var + p: ^Int + q: ^Word + diff: Int + +begin + diff := p - q (* @Error Invalid operands of type '\^Int' and '\^Word' for operator - *) +end. -- cgit v1.2.3