mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:21:04 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user