Skip to content

Commit e63a887

Browse files
authored
Merge pull request #71027 from beccadax/globally-lazy-minimum
[ClangImporter] Break cycle in IAM extensions
2 parents 28cb007 + 0683f39 commit e63a887

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9043,6 +9043,11 @@ ClangImporter::Implementation::importDeclContextOf(
90439043
nominal->getDeclaredType());
90449044
SwiftContext.evaluator.cacheOutput(ExtendedNominalRequest{ext},
90459045
std::move(nominal));
9046+
9047+
// Record this extension so we can find it later. We do this early because
9048+
// once we've set the member loader, we don't know when the compiler will use
9049+
// it and end up back in this method.
9050+
extensionPoints[extensionKey] = ext;
90469051
ext->setMemberLoader(this, reinterpret_cast<uintptr_t>(declSubmodule));
90479052

90489053
if (auto protoDecl = ext->getExtendedProtocolDecl()) {
@@ -9052,8 +9057,6 @@ ClangImporter::Implementation::importDeclContextOf(
90529057
// Add the extension to the nominal type.
90539058
nominal->addExtension(ext);
90549059

9055-
// Record this extension so we can find it later.
9056-
extensionPoints[extensionKey] = ext;
90579060
return ext;
90589061
}
90599062

0 commit comments

Comments
 (0)