diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-29 01:16:18 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-29 01:16:18 +0200 |
| commit | f8daedce5c73e02dfb2fc59d75777190185584df (patch) | |
| tree | 9ec211b96c3d7efd2fca0da37baeaa8b341e31fb /testsuite | |
| parent | 36a274c9a8bca944234589220def025d3920b3ef (diff) | |
| download | elna-f8daedce5c73e02dfb2fc59d75777190185584df.tar.gz | |
Validate cast compatibility during semantic analysis
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/fail_compilation/while_condition.elna | 2 | ||||
| -rw-r--r-- | testsuite/runnable/slice_cast.elna | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/testsuite/fail_compilation/while_condition.elna b/testsuite/fail_compilation/while_condition.elna index 73fed95..1e17489 100644 --- a/testsuite/fail_compilation/while_condition.elna +++ b/testsuite/fail_compilation/while_condition.elna @@ -1,4 +1,4 @@ begin - while 1 do (* @Error Condition must be a boolean, got 'Int' *) + while 1 do (* @Error Condition must be a boolean expression, but got 'Int' *) end end. diff --git a/testsuite/runnable/slice_cast.elna b/testsuite/runnable/slice_cast.elna new file mode 100644 index 0000000..5ab2c93 --- /dev/null +++ b/testsuite/runnable/slice_cast.elna @@ -0,0 +1,6 @@ +var + ints: [4]Int := [4]Int{ 1, 2, 3, 4 } + +begin + assert(cast(ints[1u to 4u]: []Char).length = #size(Int) * ints.length) +end. |
