aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/coercion_to_error_union.zig
blob: 40198ef06ad103a8a31ea400d00fd511124c7c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
export fn b() void {
    const x: anyerror!u8 = 256;
    _ = x;
}

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