Sema: fix initialization of array with comptime only elem type
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user