AstGen: improve generated Zir for array init exprs

This commit is contained in:
Veikka Tuominen
2022-05-28 18:38:35 +03:00
parent ee651c3cd3
commit c7b778992e
6 changed files with 57 additions and 141 deletions

View File

@@ -942,3 +942,10 @@ test "comptime int in switch in catch is casted to correct inferred type" {
};
_ = b;
}
test "vector initialized with array init syntax has proper type" {
comptime {
const actual = -@Vector(4, i32){ 1, 2, 3, 4 };
try std.testing.expectEqual(@Vector(4, i32){ -1, -2, -3, -4 }, actual);
}
}