diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-01 01:55:44 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-01 01:55:44 +0200 |
| commit | b3a7a5731285625aa9fc6a347841591757860edb (patch) | |
| tree | 94b267ea425a15e7c9bc63c15d8d5580048dd545 /testsuite | |
| parent | 0f5e9f00b07606871a6289060fa904555d41ae7d (diff) | |
| download | elna-cpp.tar.gz | |
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/compilable/const_element_array.elna | 9 | ||||
| -rw-r--r-- | testsuite/compilable/const_extern.elna | 5 | ||||
| -rw-r--r-- | testsuite/fail_compilation/assign_const_element.elna | 11 |
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/compilable/const_element_array.elna b/testsuite/compilable/const_element_array.elna new file mode 100644 index 0000000..a812d23 --- /dev/null +++ b/testsuite/compilable/const_element_array.elna @@ -0,0 +1,9 @@ +type + CI = const Int + +var + a: [3]CI := [1, 2, 3] + b: [3]CI + +begin +end. diff --git a/testsuite/compilable/const_extern.elna b/testsuite/compilable/const_extern.elna new file mode 100644 index 0000000..8df801e --- /dev/null +++ b/testsuite/compilable/const_extern.elna @@ -0,0 +1,5 @@ +var + errno_like: const Int := extern + +begin +end. diff --git a/testsuite/fail_compilation/assign_const_element.elna b/testsuite/fail_compilation/assign_const_element.elna new file mode 100644 index 0000000..9b9c341 --- /dev/null +++ b/testsuite/fail_compilation/assign_const_element.elna @@ -0,0 +1,11 @@ +type + CI = const Int + +proc f() +var + a: [3]CI := [1, 2, 3] +begin + a[1] := 6 (* @Error Cannot assign to a value of type 'CI', because it is constant or contains constant members *) +return + +end. |
