| 1 | const S = struct {}; |
| 2 | const sentinel: S = .{}; |
| 3 | |
| 4 | comptime { |
| 5 | _ = [0:sentinel]S; |
| 6 | } |
| 7 | comptime { |
| 8 | _ = [:sentinel]S; |
| 9 | } |
| 10 | comptime { |
| 11 | _ = [*:sentinel]S; |
| 12 | } |
| 13 | |
| 14 | comptime { |
| 15 | _ = @Pointer(.slice, .{}, S, sentinel); |
| 16 | } |
| 17 | comptime { |
| 18 | _ = @Pointer(.many, .{}, S, sentinel); |
| 19 | } |
| 20 | |
| 21 | // error |
| 22 | // |
| 23 | // :5:12: error: non-scalar sentinel type 'tmp.S' |
| 24 | // :1:11: note: struct declared here |
| 25 | // :8:11: error: non-scalar sentinel type 'tmp.S' |
| 26 | // :1:11: note: struct declared here |
| 27 | // :11:12: error: non-scalar sentinel type 'tmp.S' |
| 28 | // :1:11: note: struct declared here |
| 29 | // :15:34: error: non-scalar sentinel type 'tmp.S' |
| 30 | // :1:11: note: struct declared here |
| 31 | // :18:33: error: non-scalar sentinel type 'tmp.S' |
| 32 | // :1:11: note: struct declared here |