| 1 | const NextError = error{NextError}; |
| 2 | const OtherError = error{OutOfMemory}; |
| 3 | |
| 4 | export fn entry() void { |
| 5 | const a: ?NextError!i32 = foo(); |
| 6 | _ = a; |
| 7 | } |
| 8 | |
| 9 | fn foo() ?OtherError!i32 { |
| 10 | return null; |
| 11 | } |
| 12 | |
| 13 | // error |
| 14 | // |
| 15 | // :5:34: error: expected type '?error{NextError}!i32', found '?error{OutOfMemory}!i32' |
| 16 | // :5:34: note: optional type child 'error{OutOfMemory}!i32' cannot cast into optional type child 'error{NextError}!i32' |
| 17 | // :5:34: note: 'error.OutOfMemory' not a member of destination error set |