mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #18813 from xedin/switch-to-use-generic-signature-of-context
[Diagnostics] NFC: refactor `getRequirementDC` to use `getGenericSign…
This commit is contained in:
@@ -107,18 +107,11 @@ const DeclContext *RequirementFailure::getRequirementDC() const {
|
||||
auto *DC = AffectedDecl->getDeclContext();
|
||||
|
||||
do {
|
||||
auto *D = DC->getInnermostDeclarationDeclContext();
|
||||
if (!D)
|
||||
break;
|
||||
|
||||
if (auto *GC = D->getAsGenericContext()) {
|
||||
auto *sig = GC->getGenericSignature();
|
||||
if (sig && sig->isRequirementSatisfied(req))
|
||||
if (auto *sig = DC->getGenericSignatureOfContext()) {
|
||||
if (sig->isRequirementSatisfied(req))
|
||||
return DC;
|
||||
}
|
||||
|
||||
DC = DC->getParent();
|
||||
} while (DC);
|
||||
} while ((DC = DC->getParent()));
|
||||
|
||||
return AffectedDecl->getAsGenericContext();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user