| 1 | const U = union { |
| 2 | comptime a: u32 = 1, |
| 3 | }; |
| 4 | const E = enum { |
| 5 | comptime a = 1, |
| 6 | }; |
| 7 | const P = packed struct { |
| 8 | comptime a: u32 = 1, |
| 9 | }; |
| 10 | const X = extern struct { |
| 11 | comptime a: u32 = 1, |
| 12 | }; |
| 13 | |
| 14 | // error |
| 15 | // |
| 16 | // :2:5: error: union fields cannot be marked comptime |
| 17 | // :5:5: error: enum fields cannot be marked comptime |
| 18 | // :8:5: error: packed struct fields cannot be marked comptime |
| 19 | // :11:5: error: extern struct fields cannot be marked comptime |