zig/test/cases/compile_errors/slice_sentinel_mismatch-2.zig
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00

16 lines
301 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