AST: Allow ConformanceLookupTable::forEachInStage() to find ExtensionDecls in the Builtin module

This commit is contained in:
Slava Pestov
2023-08-09 13:36:47 -04:00
parent 7f9a71cd15
commit ea098b56b7

View File

@@ -202,7 +202,8 @@ void ConformanceLookupTable::forEachInStage(ConformanceStage stage,
for (auto conf : conformances) {
protocols.push_back({conf->getProtocol(), SourceLoc(), SourceLoc()});
}
} else if (next->getParentSourceFile()) {
} else if (next->getParentSourceFile() ||
next->getParentModule()->isBuiltinModule()) {
bool anyObject = false;
for (const auto &found :
getDirectlyInheritedNominalTypeDecls(next, anyObject)) {
@@ -418,8 +419,10 @@ void ConformanceLookupTable::loadAllConformances(
ArrayRef<ProtocolConformance*> conformances) {
// If this declaration context came from source, there's nothing to
// do here.
if (dc->getParentSourceFile())
if (dc->getParentSourceFile() ||
dc->getParentModule()->isBuiltinModule()) {
return;
}
// Add entries for each loaded conformance.
for (auto conformance : conformances) {