We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getRequirementDC
getGenericSignatureOfContext
1 parent 1ea3ebc commit e1ad307Copy full SHA for e1ad307
lib/Sema/CSDiagnostics.cpp
@@ -107,18 +107,11 @@ const DeclContext *RequirementFailure::getRequirementDC() const {
107
auto *DC = AffectedDecl->getDeclContext();
108
109
do {
110
- auto *D = DC->getInnermostDeclarationDeclContext();
111
- if (!D)
112
- break;
113
-
114
- if (auto *GC = D->getAsGenericContext()) {
115
- auto *sig = GC->getGenericSignature();
116
- if (sig && sig->isRequirementSatisfied(req))
+ if (auto *sig = DC->getGenericSignatureOfContext()) {
+ if (sig->isRequirementSatisfied(req))
117
return DC;
118
}
119
120
- DC = DC->getParent();
121
- } while (DC);
+ } while ((DC = DC->getParent()));
122
123
return AffectedDecl->getAsGenericContext();
124
0 commit comments