From 2b93546b39a85e9316c2bf12f336c357577114fa Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Fri, 3 Jun 2022 16:10:18 +0300 Subject: Sema: fix initialization of array with comptime only elem type --- test/behavior/array.zig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/behavior/array.zig') diff --git a/test/behavior/array.zig b/test/behavior/array.zig index 93de42df67..bccff1edf0 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -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); +} -- cgit v1.2.3