From 71b3bbb7698b13b42c99a4ca66c27db4a6189ff8 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Aug 2026 16:05:51 +0200 Subject: Enforce integral values in slice ranges --- testsuite/fail_compilation/constant_enum_to_int.elna | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 testsuite/fail_compilation/constant_enum_to_int.elna (limited to 'testsuite') diff --git a/testsuite/fail_compilation/constant_enum_to_int.elna b/testsuite/fail_compilation/constant_enum_to_int.elna new file mode 100644 index 0000000..f97bd3f --- /dev/null +++ b/testsuite/fail_compilation/constant_enum_to_int.elna @@ -0,0 +1,10 @@ +type + Enumeration = (one, two, three) + +var + x: [3]Int := [3]Int{ 1, 2, 3 } + y: []Int + +begin + y := x[Enumeration.one to Enumeration.two] (* @Error Array index must be an integral type, but got 'Enumeration' *) +end. -- cgit v1.2.3