Files
zig/test/cases/compile_errors/invalid_pointer_to_opaque.zig
Ali Cheraghi dec1163fbb all: replace all @Type usages
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-22 22:42:38 +00:00

29 lines
801 B
Zig

export fn a() void {
_ = []anyopaque;
}
export fn b() void {
_ = [*]anyopaque;
}
export fn c() void {
_ = [*c]anyopaque;
}
export fn d() void {
_ = @Pointer(.slice, .{}, anyopaque, null);
}
export fn e() void {
_ = @Pointer(.many, .{}, anyopaque, null);
}
export fn f() void {
_ = @Pointer(.c, .{}, anyopaque, null);
}
// error
//
// :2:11: error: indexable pointer to opaque type 'anyopaque' not allowed
// :5:12: error: indexable pointer to opaque type 'anyopaque' not allowed
// :8:13: error: indexable pointer to opaque type 'anyopaque' not allowed
// :12:9: error: indexable pointer to opaque type 'anyopaque' not allowed
// :15:9: error: indexable pointer to opaque type 'anyopaque' not allowed
// :18:9: error: indexable pointer to opaque type 'anyopaque' not allowed