mirror of
https://github.com/ziglang/zig.git
synced 2025-12-13 17:53:07 +00:00
14 lines
296 B
Zig
14 lines
296 B
Zig
fn foo() [:0]u8 {
|
|
var x: []u8 = undefined;
|
|
return x;
|
|
}
|
|
comptime { _ = foo; }
|
|
|
|
// error
|
|
// backend=stage2
|
|
// target=native
|
|
//
|
|
// :3:12: error: expected type '[:0]u8', found '[]u8'
|
|
// :3:12: note: destination pointer requires '0' sentinel
|
|
// :1:10: note: function return type declared here
|