AST: Factor out a new Requirement::getProtocolDecl() utility method

This commit is contained in:
Slava Pestov
2021-02-25 17:13:57 -05:00
parent 8ae1b768f1
commit 53e06d69b5
24 changed files with 74 additions and 107 deletions

View File

@@ -2533,8 +2533,7 @@ static bool usesFeatureRethrowsProtocol(
->getGenericSignatureOfContext()) {
for (const auto &req : genericSig->getRequirements()) {
if (req.getKind() == RequirementKind::Conformance &&
usesFeatureRethrowsProtocol(
req.getSecondType()->getAs<ProtocolType>()->getDecl(), checked))
usesFeatureRethrowsProtocol(req.getProtocolDecl(), checked))
return true;
}
}