aboutsummaryrefslogtreecommitdiff
path: root/test/standalone/strip_struct_init/main.zig
blob: 4f3d63c960cc147dfead795cdf55c00cbe18f1f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
fn Func(comptime Type: type) type {
    return struct { value: Type };
}

inline fn func(value: anytype) Func(@TypeOf(value)) {
    return .{ .value = value };
}

test {
    _ = func(type);
}

test {
    const S = struct { field: u32 };
    comptime var arr: [1]S = undefined;
    arr[0] = .{ .field = 0 };
}

test {
    const S = struct { u32 };
    comptime var arr: [1]S = undefined;
    arr[0] = .{0};
}