Skip upfront emission of vtables for generic classes (#5349)

These will need to be emitted lazily, as we do for functions - this
addresses the crash/removes the impossible (because we don't have a
specific) non-lazy path.
This commit is contained in:
David Blaikie
2025-04-23 22:55:07 +00:00
committed by GitHub
parent b00a037c52
commit 77c5f63be7
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -732,6 +732,12 @@ auto FileContext::BuildVtable(const SemIR::Class& class_info)
return nullptr;
}
// Vtables can't be generated for generics, only for their specifics - and
// must be done lazily based on the use of those specifics.
if (class_info.generic_id != SemIR::GenericId::None) {
return nullptr;
}
Mangler m(*this);
std::string mangled_name = m.MangleVTable(class_info);