Sema: add note suggesting dropping try on non error-unions
This commit is contained in:
@@ -13,4 +13,5 @@ pub fn bar() u8 {
|
||||
// error
|
||||
//
|
||||
// :6:12: error: expected error union type, found 'u8'
|
||||
// :6:12: note: consider omitting 'try'
|
||||
// :2:8: note: called at comptime here
|
||||
|
||||
@@ -43,10 +43,16 @@ comptime {
|
||||
// error
|
||||
//
|
||||
// :5:23: error: expected error union type, found 'comptime_int'
|
||||
// :5:23: note: consider omitting 'try'
|
||||
// :10:23: error: expected error union type, found '@TypeOf(.{})'
|
||||
// :10:23: note: consider omitting 'try'
|
||||
// :15:23: error: expected error union type, found 'tmp.S'
|
||||
// :1:11: note: struct declared here
|
||||
// :15:23: note: consider omitting 'try'
|
||||
// :20:27: error: expected error union type, found 'tmp.S'
|
||||
// :1:11: note: struct declared here
|
||||
// :20:27: note: consider omitting 'try'
|
||||
// :25:23: error: expected error union type, found 'struct { comptime *const [5:0]u8 = "hello" }'
|
||||
// :25:23: note: consider omitting 'try'
|
||||
// :31:13: error: expected error union type, found 'u32'
|
||||
// :31:13: note: consider omitting 'try'
|
||||
|
||||
Reference in New Issue
Block a user