aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/13171.zig
blob: 11579a73567f41128e5e147f9a6dc2d918bcb10c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
}