aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-03-07 08:26:00 -0800
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-03-07 08:26:00 -0800
commit85b0a4a8fd8a56c07e0377b02d33753fe205fe41 (patch)
tree175a059ce3b60e6da72cc1e3c70b37d0af54a216 /test/behavior/array.zig
parentc9fac41368c872d424681ea3cf93a9d97157143e (diff)
downloadzig-85b0a4a8fd8a56c07e0377b02d33753fe205fe41.tar.gz
zig-85b0a4a8fd8a56c07e0377b02d33753fe205fe41.zip
stage2: new zir array_init_sent for sentinel-terminated array inits
This uses a new ZIR inst `array_init_sent` (and a ref equivalent) to represent array init expressions that terminate in a a sentinel value. The sentienl value is the last value in the `MultiOp` payload. This makes it a bit more awkward to deal with (lots of "len - 1") but makes it so that the payload matches the fact that sentinels appear at the end of arrays. However, this is not a hill I want to die on so if we want to change it to index 0, I'm happy to do so. This makes the following work properly: try expect(@TypeOf([_:0]u8{}) == [0:0]u8);
Diffstat (limited to 'test/behavior/array.zig')
0 files changed, 0 insertions, 0 deletions