| ... | @@ -6151,7 +6151,11 @@ static IrInstruction *ir_gen_container_init_expr(IrBuilder *irb, Scope *scope, A | ... | @@ -6151,7 +6151,11 @@ static IrInstruction *ir_gen_container_init_expr(IrBuilder *irb, Scope *scope, A |
| 6151 | init_array_type_source_node = container_type->source_node; | 6151 | init_array_type_source_node = container_type->source_node; |
| 6152 | } else { | 6152 | } else { |
| 6153 | child_result_loc = parent_result_loc; | 6153 | child_result_loc = parent_result_loc; |
| 6154 | init_array_type_source_node = parent_result_loc->source_instruction->source_node; | 6154 | if (parent_result_loc->source_instruction != nullptr) { |
| | 6155 | init_array_type_source_node = parent_result_loc->source_instruction->source_node; |
| | 6156 | } else { |
| | 6157 | init_array_type_source_node = node; |
| | 6158 | } |
| 6155 | } | 6159 | } |
| 6156 | | 6160 | |
| 6157 | switch (kind) { | 6161 | switch (kind) { |
| ... | @@ -15935,6 +15939,10 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, | ... | @@ -15935,6 +15939,10 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, |
| 15935 | instruction->result_loc->source_instruction->child); | 15939 | instruction->result_loc->source_instruction->child); |
| 15936 | if (type_is_invalid(implicit_elem_type)) | 15940 | if (type_is_invalid(implicit_elem_type)) |
| 15937 | return ira->codegen->invalid_instruction; | 15941 | return ira->codegen->invalid_instruction; |
| | 15942 | } else if (instruction->result_loc->id == ResultLocIdReturn) { |
| | 15943 | implicit_elem_type = ira->explicit_return_type; |
| | 15944 | if (type_is_invalid(implicit_elem_type)) |
| | 15945 | return ira->codegen->invalid_instruction; |
| 15938 | } else { | 15946 | } else { |
| 15939 | Buf *bare_name = buf_alloc(); | 15947 | Buf *bare_name = buf_alloc(); |
| 15940 | Buf *name = get_anon_type_name(ira->codegen, nullptr, container_string(ContainerKindStruct), | 15948 | Buf *name = get_anon_type_name(ira->codegen, nullptr, container_string(ContainerKindStruct), |