mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
22 lines
626 B
Zig
22 lines
626 B
Zig
export fn foo() void {
|
|
comptime var a: u8 = 0;
|
|
_ = [0:&a]*u8;
|
|
}
|
|
|
|
export fn baz() void {
|
|
comptime var a: u8 = 0;
|
|
_ = [:&a]*u8;
|
|
}
|
|
export fn qux() void {
|
|
comptime var a: u8 = 0;
|
|
_ = @Pointer(.many, .{}, *u8, &a);
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :3:12: error: sentinel contains reference to comptime var
|
|
// :2:14: note: 'sentinel' points to comptime var declared here
|
|
// :8:11: error: sentinel contains reference to comptime var
|
|
// :7:14: note: 'sentinel' points to comptime var declared here
|
|
// :12:35: error: sentinel contains reference to comptime var
|
|
// :11:14: note: 'sentinel' points to comptime var declared here
|