aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/11162.zig
blob: 6b4cef78e7be685e98f93fff58eae223c483acab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const std = @import("std");
const builtin = @import("builtin");
const expect = std.testing.expect;

test "aggregate initializers should allow initializing comptime fields, verifying equality" {
    if (true) return error.SkipZigTest; // TODO

    var x: u32 = 15;
    const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });
    var a: T = .{ -1234, 5678, x + 1 };

    try expect(a[0] == -1234);
    try expect(a[1] == 5678);
    try expect(a[2] == 16);
}