My current Zig understanding is
- The item type of a single-item pointer can’t be
noreturn. - The item type of an array/slice/many-item-pointer can’t be
noreturnandopaquetypes.
So is it a bug to allow [0..1] slicing on *const anyopaque values?
const print = @import("std").debug.print;
pub fn main() void {
const v: u8 = 123;
const p: *const anyopaque = &v;
const s = p[0..1]; // compiles okay, but a bug?
print("{}\n", .{ @TypeOf(s) }); // *const [1]anyopaque
const T = *const [1]anyopaque; // error: array of opaque type 'anyopaque' not allowed
print("{}\n", .{ T });
}