| ... | @@ -2257,6 +2257,9 @@ fn failWithOwnedErrorMsg(sema: *Sema, err_msg: *Module.ErrorMsg) CompileError { | ... | @@ -2257,6 +2257,9 @@ fn failWithOwnedErrorMsg(sema: *Sema, err_msg: *Module.ErrorMsg) CompileError { |
| 2257 | sema.owner_decl.analysis = .sema_failure; | 2257 | sema.owner_decl.analysis = .sema_failure; |
| 2258 | sema.owner_decl.generation = mod.generation; | 2258 | sema.owner_decl.generation = mod.generation; |
| 2259 | } | 2259 | } |
| | 2260 | if (sema.func) |func| { |
| | 2261 | func.state = .sema_failure; |
| | 2262 | } |
| 2260 | const gop = mod.failed_decls.getOrPutAssumeCapacity(sema.owner_decl_index); | 2263 | const gop = mod.failed_decls.getOrPutAssumeCapacity(sema.owner_decl_index); |
| 2261 | if (gop.found_existing) { | 2264 | if (gop.found_existing) { |
| 2262 | // If there are multiple errors for the same Decl, prefer the first one added. | 2265 | // If there are multiple errors for the same Decl, prefer the first one added. |
| ... | @@ -6385,6 +6388,7 @@ fn analyzeCall( | ... | @@ -6385,6 +6388,7 @@ fn analyzeCall( |
| 6385 | }), | 6388 | }), |
| 6386 | else => unreachable, | 6389 | else => unreachable, |
| 6387 | }; | 6390 | }; |
| | 6391 | if (!is_comptime_call and module_fn.state == .sema_failure) return error.AnalysisFail; |
| 6388 | | 6392 | |
| 6389 | // Analyze the ZIR. The same ZIR gets analyzed into a runtime function | 6393 | // Analyze the ZIR. The same ZIR gets analyzed into a runtime function |
| 6390 | // or an inlined call depending on what union tag the `label` field is | 6394 | // or an inlined call depending on what union tag the `label` field is |