| ... | ... | @@ -3872,7 +3872,11 @@ static IrInstruction *ir_gen_container_decl(IrBuilder *irb, Scope *parent_scope, |
| 3872 | 3872 | } else { |
| 3873 | 3873 | FnTableEntry *fn_entry = exec_fn_entry(irb->exec); |
| 3874 | 3874 | if (fn_entry) { |
| 3875 | | zig_panic("TODO name the container inside the function"); |
| 3875 | name = buf_alloc(); |
| 3876 | buf_append_buf(name, &fn_entry->symbol_name); |
| 3877 | buf_appendf(name, "("); |
| 3878 | // TODO render args |
| 3879 | buf_appendf(name, ")"); |
| 3876 | 3880 | } else { |
| 3877 | 3881 | name = buf_sprintf("(anonymous %s at %s:%zu:%zu)", container_string(kind), |
| 3878 | 3882 | buf_ptr(node->owner->path), node->line + 1, node->column + 1); |
| ... | ... | @@ -6115,18 +6119,25 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 6115 | 6119 | } |
| 6116 | 6120 | } |
| 6117 | 6121 | |
| 6118 | | auto existing_entry = ira->codegen->generic_table.put_unique(generic_id, impl_fn); |
| 6119 | | if (existing_entry) { |
| 6120 | | // throw away all our work and use the existing function |
| 6121 | | impl_fn = existing_entry->value; |
| 6122 | | } else { |
| 6123 | | // finish instantiating the function |
| 6122 | { |
| 6124 | 6123 | AstNode *return_type_node = fn_proto_node->data.fn_proto.return_type; |
| 6125 | 6124 | TypeTableEntry *return_type = analyze_type_expr(ira->codegen, impl_fn->child_scope, return_type_node); |
| 6126 | 6125 | if (return_type->id == TypeTableEntryIdInvalid) |
| 6127 | 6126 | return ira->codegen->builtin_types.entry_invalid; |
| 6128 | 6127 | fn_type_id.return_type = return_type; |
| 6129 | 6128 | |
| 6129 | if (type_requires_comptime(return_type)) { |
| 6130 | // Throw out our work and call the function as if it were inline. |
| 6131 | return ir_analyze_fn_call(ira, call_instruction, fn_entry, fn_type, fn_ref, first_arg_ptr, true); |
| 6132 | } |
| 6133 | } |
| 6134 | |
| 6135 | auto existing_entry = ira->codegen->generic_table.put_unique(generic_id, impl_fn); |
| 6136 | if (existing_entry) { |
| 6137 | // throw away all our work and use the existing function |
| 6138 | impl_fn = existing_entry->value; |
| 6139 | } else { |
| 6140 | // finish instantiating the function |
| 6130 | 6141 | impl_fn->type_entry = get_fn_type(ira->codegen, &fn_type_id); |
| 6131 | 6142 | if (impl_fn->type_entry->id == TypeTableEntryIdInvalid) |
| 6132 | 6143 | return ira->codegen->builtin_types.entry_invalid; |