diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-08-23 20:01:55 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-08-23 20:01:55 +0200 |
| commit | 7d0d0eb69589ab8e0c8b036a3b642593a372b041 (patch) | |
| tree | cf3731cec0ab67a0d574450fbe24c3cff4a7a9e6 /testsuite/fail_compilation | |
| parent | bf41d022ce9736a92097f416ab96fca7ab4594ca (diff) | |
| download | elna-7d0d0eb69589ab8e0c8b036a3b642593a372b041.tar.gz | |
Determine array type by the first element
Diffstat (limited to 'testsuite/fail_compilation')
| -rw-r--r-- | testsuite/fail_compilation/assign_element_of_const.elna | 2 | ||||
| -rw-r--r-- | testsuite/fail_compilation/compile_time_array_ptr.elna | 2 | ||||
| -rw-r--r-- | testsuite/fail_compilation/constant_enum_to_int.elna | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/fail_compilation/assign_element_of_const.elna b/testsuite/fail_compilation/assign_element_of_const.elna index a5b5cda..8235448 100644 --- a/testsuite/fail_compilation/assign_element_of_const.elna +++ b/testsuite/fail_compilation/assign_element_of_const.elna @@ -1,6 +1,6 @@ proc f() var - a: const [2]Int := [2]Int{ 1, 3 } + a: const [2]Int := [1, 3] begin a[1] := 6 (* @Error Cannot assign to a value of type 'const Int', because it is constant or contains constant members *) return diff --git a/testsuite/fail_compilation/compile_time_array_ptr.elna b/testsuite/fail_compilation/compile_time_array_ptr.elna index dd626a6..bd630ac 100644 --- a/testsuite/fail_compilation/compile_time_array_ptr.elna +++ b/testsuite/fail_compilation/compile_time_array_ptr.elna @@ -1,5 +1,5 @@ var - source: [3]Int := [3]Int{ 1, 2, 3} + source: [3]Int := [1, 2, 3] target: ^Int := source.ptr (* @Error Variable initializers must be constant expressions *) end. diff --git a/testsuite/fail_compilation/constant_enum_to_int.elna b/testsuite/fail_compilation/constant_enum_to_int.elna index f97bd3f..4be6131 100644 --- a/testsuite/fail_compilation/constant_enum_to_int.elna +++ b/testsuite/fail_compilation/constant_enum_to_int.elna @@ -2,7 +2,7 @@ type Enumeration = (one, two, three) var - x: [3]Int := [3]Int{ 1, 2, 3 } + x: [3]Int := [1, 2, 3] y: []Int begin |
