diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp index c418149546..0e03f25e11 100644 --- a/src/stage1/ir.cpp +++ b/src/stage1/ir.cpp @@ -7607,12 +7607,7 @@ static IrInstSrc *ir_gen_fn_call(IrBuilderSrc *irb, Scope *scope, AstNode *node, bool is_nosuspend = get_scope_nosuspend(scope) != nullptr; CallModifier modifier = node->data.fn_call_expr.modifier; - if (is_nosuspend) { - if (modifier == CallModifierAsync) { - add_node_error(irb->codegen, node, - buf_sprintf("async call in nosuspend scope")); - return irb->codegen->invalid_inst_src; - } + if (is_nosuspend && modifier != CallModifierAsync) { modifier = CallModifierNoSuspend; } diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 4c2dc63e33..808f0b31dc 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1027,7 +1027,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { \\} \\fn foo() void {} , &[_][]const u8{ - "tmp.zig:3:21: error: async call in nosuspend scope", "tmp.zig:4:9: error: suspend in nosuspend scope", });