aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/13435.zig
blob: 86a43afa0cdd11b94d4b03191e29b95b98e1e81a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const std = @import("std");

fn CreateUnion(comptime T: type) type {
    return @Type(.{
        .Union = .{
            .layout = .Auto,
            .tag_type = null,
            .fields = &[_]std.builtin.Type.UnionField{
                .{
                    .name = "field",
                    .type = T,
                    .alignment = @alignOf(T),
                },
            },
            .decls = &[_]std.builtin.Type.Declaration{},
        },
    });
}

test {
    _ = CreateUnion(struct {});
}