Skip to content

Commit ea098b5

Browse files
committed
AST: Allow ConformanceLookupTable::forEachInStage() to find ExtensionDecls in the Builtin module
1 parent 7f9a71c commit ea098b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/AST/ConformanceLookupTable.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ void ConformanceLookupTable::forEachInStage(ConformanceStage stage,
202202
for (auto conf : conformances) {
203203
protocols.push_back({conf->getProtocol(), SourceLoc(), SourceLoc()});
204204
}
205-
} else if (next->getParentSourceFile()) {
205+
} else if (next->getParentSourceFile() ||
206+
next->getParentModule()->isBuiltinModule()) {
206207
bool anyObject = false;
207208
for (const auto &found :
208209
getDirectlyInheritedNominalTypeDecls(next, anyObject)) {
@@ -418,8 +419,10 @@ void ConformanceLookupTable::loadAllConformances(
418419
ArrayRef<ProtocolConformance*> conformances) {
419420
// If this declaration context came from source, there's nothing to
420421
// do here.
421-
if (dc->getParentSourceFile())
422+
if (dc->getParentSourceFile() ||
423+
dc->getParentModule()->isBuiltinModule()) {
422424
return;
425+
}
423426

424427
// Add entries for each loaded conformance.
425428
for (auto conformance : conformances) {

0 commit comments

Comments
 (0)