diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-24 18:40:04 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-24 18:40:04 +0200 |
| commit | 6301c1f2f669b84a429e836888629873721e7219 (patch) | |
| tree | 8ad4bcb634eb0e9332a6459b26a435d730a7cf8d /testsuite/fail_compilation | |
| parent | 5dc1e4c991efae2e0dd96b59bc57b2cd81a8c5fb (diff) | |
| download | elna-6301c1f2f669b84a429e836888629873721e7219.tar.gz | |
Handle array and slice field constness
Diffstat (limited to 'testsuite/fail_compilation')
| -rw-r--r-- | testsuite/fail_compilation/assign_array_length.elna | 7 | ||||
| -rw-r--r-- | testsuite/fail_compilation/assign_slice_ptr.elna | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/assign_array_length.elna b/testsuite/fail_compilation/assign_array_length.elna new file mode 100644 index 0000000..ac8f9df --- /dev/null +++ b/testsuite/fail_compilation/assign_array_length.elna @@ -0,0 +1,7 @@ +var + slice: []Int + array: [2]Int + +begin + array.length := slice.length (* @Error Cannot assign to a value of type 'const Word', because it is constant or contains constant members *) +end. diff --git a/testsuite/fail_compilation/assign_slice_ptr.elna b/testsuite/fail_compilation/assign_slice_ptr.elna new file mode 100644 index 0000000..aa7a379 --- /dev/null +++ b/testsuite/fail_compilation/assign_slice_ptr.elna @@ -0,0 +1,7 @@ +var + slice: []Int + array: [2]Int + +begin + slice.ptr := array.ptr (* @Error Cannot assign to a value of type 'const \^Int', because it is constant or contains constant members *) +end. |
