diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp index 7906df3b0..e0e08ddbc 100644 --- a/src/stage1/ir.cpp +++ b/src/stage1/ir.cpp @@ -24153,7 +24153,8 @@ static IrInstGen *ir_analyze_instruction_switch_target(IrAnalyze *ira, case ZigTypeIdUnion: { AstNode *decl_node = target_type->data.unionation.decl_node; if (!decl_node->data.container_decl.auto_enum && - decl_node->data.container_decl.init_arg_expr == nullptr) + decl_node->data.container_decl.init_arg_expr == nullptr + && target_type->data.unionation.tag_type == nullptr) { ErrorMsg *msg = ir_add_error(ira, &target_value_ptr->base, buf_sprintf("switch on union which has no attached enum"));