Reimplement derived class thunk in terms of down-casting (#7322)

This helps us move away from the clone-with-modifications approach to
thunking, which gets unwieldy as signatures get more complex.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Geoff Romer
2026-06-09 21:10:18 +00:00
committed by GitHub
co-authored by Richard Smith
parent 1a26b57732
commit 85c53fa00c
22 changed files with 630 additions and 307 deletions
+2 -4
View File
@@ -304,12 +304,10 @@ auto CheckFunctionTypeMatches(Context& context,
const SemIR::Function& new_function,
const SemIR::Function& prev_function,
SemIR::SpecificId prev_specific_id,
bool check_syntax,
SemIR::TypeId self_type_override_id,
bool diagnose) -> bool {
bool check_syntax, bool diagnose) -> bool {
if (!CheckRedeclParamsMatch(context, DeclParams(new_function),
DeclParams(prev_function), prev_specific_id,
diagnose, check_syntax, self_type_override_id)) {
diagnose, check_syntax)) {
return false;
}
if (!CheckFunctionReturnTypeMatches(context, new_function, prev_function,