mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Stop calling getAllConformances() on protocols
This commit is contained in:
@@ -8093,16 +8093,12 @@ allFromConditionalConformances(DeclContext *DC, Type baseTy,
|
||||
}
|
||||
|
||||
if (auto *protocol = candidateDC->getSelfProtocolDecl()) {
|
||||
SmallVector<ProtocolConformance *, 4> conformances;
|
||||
if (!NTD->lookupConformance(protocol, conformances))
|
||||
auto conformance = DC->getParentModule()->lookupConformance(
|
||||
baseTy, protocol);
|
||||
if (!conformance.isConcrete())
|
||||
return false;
|
||||
|
||||
// This is opportunistic, there should be a way to narrow the
|
||||
// list down to a particular declaration member comes from.
|
||||
return llvm::any_of(
|
||||
conformances, [](const ProtocolConformance *conformance) {
|
||||
return !conformance->getConditionalRequirements().empty();
|
||||
});
|
||||
return !conformance.getConcrete()->getConditionalRequirements().empty();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user