zig/test/behavior/bugs/13171.zig
2022-10-20 20:11:12 +03:00

17 lines
310 B
Zig

const std = @import("std");
const expect = std.testing.expect;
fn BuildType(comptime T: type) type {
return struct {
val: union {
b: T,
},
};
}
test {
const TestStruct = BuildType(u32);
const c = TestStruct{ .val = .{ .b = 10 } };
try expect(c.val.b == 10);
}