diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-10-09 00:52:27 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-10-09 00:52:27 +0200 |
| commit | 994e6c95929ad9551901d86617e4678920f8f357 (patch) | |
| tree | d12a438aa537ea8fb680161ec945e4a7a14af1de /testsuite | |
| parent | ea902858825aac806cd282e6d5f02ec683a995e3 (diff) | |
| download | elna-994e6c95929ad9551901d86617e4678920f8f357.tar.gz | |
Strip away constness from literals and rvalues
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/fail_compilation/record_constructor_const.elna | 10 | ||||
| -rw-r--r-- | testsuite/runnable/inferred_variable.elna | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/testsuite/fail_compilation/record_constructor_const.elna b/testsuite/fail_compilation/record_constructor_const.elna new file mode 100644 index 0000000..946105b --- /dev/null +++ b/testsuite/fail_compilation/record_constructor_const.elna @@ -0,0 +1,10 @@ +module +type + R = record + x: Int + end + +var + r := { const R; x: 1 } (* @Error Record constructor cannot have 'const' qualifier *) + +end. diff --git a/testsuite/runnable/inferred_variable.elna b/testsuite/runnable/inferred_variable.elna index e0822b8..48d7414 100644 --- a/testsuite/runnable/inferred_variable.elna +++ b/testsuite/runnable/inferred_variable.elna @@ -2,8 +2,12 @@ program() var x := 42 c: const := 10 + y := c + arr := [c, 2] begin x := x + 1; - assert(x = 43 & c = 10) + y := y + 5; + arr[1] := 99; + assert(x = 43 & c = 10 & y = 15 & arr[1] = 99 & arr[2] = 2) end. |
