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

// error
//
// 2:28: error: expected type 'anyerror!u8', found 'comptime_int'
// 2:28: note: type 'u8' cannot represent value '256'