| 1 | fn Func(comptime Type: type) type { |
| 2 | return struct { value: Type }; |
| 3 | } |
| 4 | |
| 5 | inline fn func(value: anytype) Func(@TypeOf(value)) { |
| 6 | return .{ .value = value }; |
| 7 | } |
| 8 | |
| 9 | test { |
| 10 | _ = func(type); |
| 11 | } |
| 12 | |
| 13 | test { |
| 14 | const S = struct { field: u32 }; |
| 15 | comptime var arr: [1]S = undefined; |
| 16 | arr[0] = .{ .field = 0 }; |
| 17 | } |
| 18 | |
| 19 | test { |
| 20 | const S = struct { u32 }; |
| 21 | comptime var arr: [1]S = undefined; |
| 22 | arr[0] = .{0}; |
| 23 | } |