aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/slice_sentinel_mismatch-2.zig
blob: 3cc5ac4c3914799711b5d4f047f0233b1e49237d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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