mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Store a file-level DeclContext* in protocol conformances rather than a module.
We'll need to perform name lookup based on the file-level DeclContext*, so the module no longer suffices. No functionality change here yet. Swift SVN r11523
This commit is contained in:
@@ -306,7 +306,7 @@ static ProtocolConformance *findConformance(ProtocolDecl *proto,
|
||||
return nullptr;
|
||||
|
||||
if (conformance->getProtocol() == proto) {
|
||||
if (conformance->getContainingModule() == module)
|
||||
if (conformance->getDeclContext()->getParentModule() == module)
|
||||
return conformance;
|
||||
return nullptr;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ static ProtocolConformance *findConformance(ProtocolDecl *proto,
|
||||
auto &inheritedMap = conformance->getInheritedConformances();
|
||||
auto directIter = inheritedMap.find(proto);
|
||||
if (directIter != inheritedMap.end()) {
|
||||
if (directIter->second->getContainingModule() == module)
|
||||
if (directIter->second->getDeclContext()->getParentModule() == module)
|
||||
return directIter->second;
|
||||
return nullptr;
|
||||
}
|
||||
@@ -513,7 +513,7 @@ Optional<ConformancePair> ModuleFile::maybeReadConformance(Type conformingType,
|
||||
lastRecordOffset.reset();
|
||||
|
||||
auto conformance = ctx.getConformance(conformingType, proto, SourceLoc(),
|
||||
FileContext->getParentModule(),
|
||||
FileContext,
|
||||
ProtocolConformanceState::Incomplete);
|
||||
|
||||
// Set inherited conformances.
|
||||
|
||||
Reference in New Issue
Block a user