Merge pull request #9875 from g-w1/timestimes

stage2: emit Value.repeated for `**` with array len 1
This commit is contained in:
Andrew Kelley
2021-10-02 16:05:12 -04:00
committed by GitHub
3 changed files with 38 additions and 10 deletions

View File

@@ -32,4 +32,9 @@ test "array init with mult" {
const a = 'a';
var i: [8]u8 = [2]u8{ a, 'b' } ** 4;
try expect(std.mem.eql(u8, &i, "abababab"));
// this should cause a Value.repeated to be emitted in AIR.
// TODO: find a way to test that this is actually getting emmited
var j: [4]u8 = [1]u8{'a'} ** 4;
try expect(std.mem.eql(u8, &j, "aaaa"));
}