diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-06-03 16:10:18 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-06-03 20:21:20 +0300 |
| commit | 2b93546b39a85e9316c2bf12f336c357577114fa (patch) | |
| tree | 9a7d6337843e025f460cc5572e92839730bee39d /test/behavior/array.zig | |
| parent | 4e1aa5d54377aa2b8d1395d666efb6eb935b7917 (diff) | |
| download | zig-2b93546b39a85e9316c2bf12f336c357577114fa.tar.gz zig-2b93546b39a85e9316c2bf12f336c357577114fa.zip | |
Sema: fix initialization of array with comptime only elem type
Diffstat (limited to 'test/behavior/array.zig')
| -rw-r--r-- | test/behavior/array.zig | 9 |
1 files changed, 9 insertions, 0 deletions
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); +} |
