| author | |
| committer | |
| log | 00d6a4da4981a026222e387fe18915ab45e5c11d |
| tree | 17f21b45ad92a879965aca883c63c4fb8e74e72e |
| parent | 1aacfa7186187ed467a5e3189a877493d5c620a1 |
closes #84871 files changed, 10 insertions(+), 0 deletions(-)
test/behavior/eval.zig+10| ... | ... | @@ -1703,3 +1703,13 @@ test "@inComptime" { |
| 1703 | 1703 | try expectEqual(false, S.inComptime()); |
| 1704 | 1704 | try expectEqual(true, comptime S.inComptime()); |
| 1705 | 1705 | } |
| 1706 | ||
| 1707 | // comptime partial array assign | |
| 1708 | comptime { | |
| 1709 | var foo = [3]u8{ 0x55, 0x55, 0x55 }; | |
| 1710 | var bar = [2]u8{ 1, 2 }; | |
| 1711 | foo[0..2].* = bar; | |
| 1712 | assert(foo[0] == 1); | |
| 1713 | assert(foo[1] == 2); | |
| 1714 | assert(foo[2] == 0x55); | |
| 1715 | } |