From 2e1e95dc716167853be4a4b6acaaee1688142744 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 19 Jul 2026 02:08:06 +0200 Subject: Implement initializer evaluator --- testsuite/compilable/const_var_chain.elna | 7 +++++++ testsuite/compilable/traits_size.elna | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 testsuite/compilable/const_var_chain.elna create mode 100644 testsuite/compilable/traits_size.elna (limited to 'testsuite/compilable') diff --git a/testsuite/compilable/const_var_chain.elna b/testsuite/compilable/const_var_chain.elna new file mode 100644 index 0000000..a6db8c8 --- /dev/null +++ b/testsuite/compilable/const_var_chain.elna @@ -0,0 +1,7 @@ +var + x: const Int := 42 + y: Int := x + +begin + assert(y = 42) +end. diff --git a/testsuite/compilable/traits_size.elna b/testsuite/compilable/traits_size.elna new file mode 100644 index 0000000..523045f --- /dev/null +++ b/testsuite/compilable/traits_size.elna @@ -0,0 +1,12 @@ +var + i: Int := 1 + s: Int := cast(#size(Int): Int) + a: [10]Int + as: Int := cast(#size([10]Int): Int) + p: Int := cast(#size(Pointer): Int) + +begin + assert(s > 0); + assert(as = 10 * cast(#size(Int): Int)); + assert(p > 0) +end. -- cgit v1.2.3