| ... | ... | @@ -4398,6 +4398,7 @@ static Error analyze_callee_async(CodeGen *g, ZigFn *fn, ZigFn *callee, AstNode |
| 4398 | 4398 | } |
| 4399 | 4399 | } |
| 4400 | 4400 | if (callee_is_async) { |
| 4401 | bool bad_recursion = (fn->inferred_async_node == inferred_async_none); |
| 4401 | 4402 | fn->inferred_async_node = call_node; |
| 4402 | 4403 | fn->inferred_async_fn = callee; |
| 4403 | 4404 | if (must_not_be_async) { |
| ... | ... | @@ -4407,6 +4408,12 @@ static Error analyze_callee_async(CodeGen *g, ZigFn *fn, ZigFn *callee, AstNode |
| 4407 | 4408 | add_async_error_notes(g, msg, fn); |
| 4408 | 4409 | return ErrorSemanticAnalyzeFail; |
| 4409 | 4410 | } |
| 4411 | if (bad_recursion) { |
| 4412 | ErrorMsg *msg = add_node_error(g, fn->proto_node, |
| 4413 | buf_sprintf("recursive function cannot be async")); |
| 4414 | add_async_error_notes(g, msg, fn); |
| 4415 | return ErrorSemanticAnalyzeFail; |
| 4416 | } |
| 4410 | 4417 | if (fn->assumed_non_async != nullptr) { |
| 4411 | 4418 | ErrorMsg *msg = add_node_error(g, fn->proto_node, |
| 4412 | 4419 | buf_sprintf("unable to infer whether '%s' should be async", |