From a0e1740227535adc3151c02eb102c4f96b4f9731 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 17 Jul 2026 10:18:58 +0200 Subject: Implement type constness --- testsuite/compilable/float_literals.elna | 10 +++++----- testsuite/compilable/pointer_const_conversion.elna | 7 +++++++ testsuite/compilable/take_const_address.elna | 7 +++++++ 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 testsuite/compilable/pointer_const_conversion.elna create mode 100644 testsuite/compilable/take_const_address.elna (limited to 'testsuite/compilable') diff --git a/testsuite/compilable/float_literals.elna b/testsuite/compilable/float_literals.elna index ed23989..77af6b1 100644 --- a/testsuite/compilable/float_literals.elna +++ b/testsuite/compilable/float_literals.elna @@ -1,9 +1,9 @@ proc f() -const - x := 3.14 - y := 1e10 - z := 4.567e8 - t := 2.5E-3 +var + x: const Float := 3.14 + y: const Float := 1e10 + z: const Float := 4.567e8 + t: const Float := 2.5E-3 return end. diff --git a/testsuite/compilable/pointer_const_conversion.elna b/testsuite/compilable/pointer_const_conversion.elna new file mode 100644 index 0000000..fd8e097 --- /dev/null +++ b/testsuite/compilable/pointer_const_conversion.elna @@ -0,0 +1,7 @@ +var + x: Int + p: ^const Int + +begin + p := @x +end. diff --git a/testsuite/compilable/take_const_address.elna b/testsuite/compilable/take_const_address.elna new file mode 100644 index 0000000..54a2992 --- /dev/null +++ b/testsuite/compilable/take_const_address.elna @@ -0,0 +1,7 @@ +var + x: ^const Int + y: const Int + +begin + x := @y +end. -- cgit v1.2.3