mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-28 11:27:09 +03:00
dec1163fbb
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
33 lines
719 B
Zig
33 lines
719 B
Zig
const S = struct {};
|
|
const sentinel: S = .{};
|
|
|
|
comptime {
|
|
_ = [0:sentinel]S;
|
|
}
|
|
comptime {
|
|
_ = [:sentinel]S;
|
|
}
|
|
comptime {
|
|
_ = [*:sentinel]S;
|
|
}
|
|
|
|
comptime {
|
|
_ = @Pointer(.slice, .{}, S, sentinel);
|
|
}
|
|
comptime {
|
|
_ = @Pointer(.many, .{}, S, sentinel);
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :5:12: error: non-scalar sentinel type 'tmp.S'
|
|
// :1:11: note: struct declared here
|
|
// :8:11: error: non-scalar sentinel type 'tmp.S'
|
|
// :1:11: note: struct declared here
|
|
// :11:12: error: non-scalar sentinel type 'tmp.S'
|
|
// :1:11: note: struct declared here
|
|
// :15:34: error: non-scalar sentinel type 'tmp.S'
|
|
// :1:11: note: struct declared here
|
|
// :18:33: error: non-scalar sentinel type 'tmp.S'
|
|
// :1:11: note: struct declared here
|