aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/coercion_to_optional.zig
blob: 9002e4d35594c303dd199ca35301704834fdada2 (plain)
1
2
3
4
5
6
7
8
9
10
11
export fn a() void {
    const x: ?u8 = 256;
    _ = x;
}

// error
// backend=stage2
// target=native
//
// 2:20: error: expected type '?u8', found 'comptime_int'
// 2:20: note: type 'u8' cannot represent value '256'