Sema: fix initialization of array with comptime only elem type

This commit is contained in:
Veikka Tuominen
2022-06-03 16:10:18 +03:00
parent 4e1aa5d543
commit 2b93546b39
2 changed files with 20 additions and 9 deletions

View File

@@ -573,3 +573,12 @@ test "type coercion of pointer to anon struct literal to pointer to array" {
try S.doTheTest();
comptime try S.doTheTest();
}
test "array with comptime only element type" {
const a = [_]type{
u32,
i32,
};
try testing.expect(a[0] == u32);
try testing.expect(a[1] == i32);
}