| ... | @@ -2238,6 +2238,7 @@ fn failWithExpectedOptionalType(sema: *Sema, block: *Block, src: LazySrcLoc, non | ... | @@ -2238,6 +2238,7 @@ fn failWithExpectedOptionalType(sema: *Sema, block: *Block, src: LazySrcLoc, non |
| 2238 | if (non_optional_ty.zigTypeTag(mod) == .ErrorUnion) { | 2238 | if (non_optional_ty.zigTypeTag(mod) == .ErrorUnion) { |
| 2239 | try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{}); | 2239 | try sema.errNote(block, src, msg, "consider using 'try', 'catch', or 'if'", .{}); |
| 2240 | } | 2240 | } |
| | 2241 | try addDeclaredHereNote(sema, msg, non_optional_ty); |
| 2241 | break :msg msg; | 2242 | break :msg msg; |
| 2242 | }; | 2243 | }; |
| 2243 | return sema.failWithOwnedErrorMsg(block, msg); | 2244 | return sema.failWithOwnedErrorMsg(block, msg); |