Factor out definition merging logic. (#7154)

Move logic to merge class and function definitions onto Class and
Function, matching how we handle merging for EntityWithParamsBase.

Assisted-by: Gemini via Antigravity
This commit is contained in:
Richard Smith
2026-05-01 22:45:22 +00:00
committed by GitHub
parent 46bb0fecd4
commit b5877d8afa
5 changed files with 24 additions and 12 deletions
-6
View File
@@ -169,12 +169,6 @@ static auto MergeFunctionRedecl(Context& context,
// Track the signature from the definition, so that IDs in the body
// match IDs in the signature.
prev_function.MergeDefinition(new_function);
prev_function.call_param_patterns_id = new_function.call_param_patterns_id;
prev_function.call_params_id = new_function.call_params_id;
prev_function.return_type_inst_id = new_function.return_type_inst_id;
prev_function.return_form_inst_id = new_function.return_form_inst_id;
prev_function.return_pattern_id = new_function.return_pattern_id;
prev_function.self_param_id = new_function.self_param_id;
}
if (prev_import_ir_id.has_value()) {
ReplacePrevInstForMerge(context, new_function.parent_scope_id,