diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-11-04 22:28:14 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-11-05 13:22:21 +0200 |
| commit | f96748ebc19b0c083569e7677f65fe4454c32b57 (patch) | |
| tree | 8d77d29226a5033b37c2b2822b9d108189db70a7 /test/behavior | |
| parent | f92e7bed7b6b83b2cdfe2bfed047e3a7bcdd2116 (diff) | |
| download | zig-f96748ebc19b0c083569e7677f65fe4454c32b57.tar.gz zig-f96748ebc19b0c083569e7677f65fe4454c32b57.zip | |
Sema: coerce elements of array cat
Closes #13347
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/eval.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/behavior/eval.zig b/test/behavior/eval.zig index 617cc6dfd4..8a669b28f3 100644 --- a/test/behavior/eval.zig +++ b/test/behavior/eval.zig @@ -1488,3 +1488,14 @@ test "x or true is comptime-known true" { } try expect(T.x == 3); } + +test "non-optional and optional array elements concatenated" { + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO + + const array = [1]u8{'A'} ++ [1]?u8{null}; + var index: usize = 0; + try expect(array[index].? == 'A'); +} |
