Skip to content

Commit b891b56

Browse files
committed
Sema: Use forEachAssociatedConformance() from ensureRequirementsAreSatisfied()
1 parent 229398c commit b891b56

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,10 +5196,8 @@ void ConformanceChecker::ensureRequirementsAreSatisfied() {
51965196
return false;
51975197
});
51985198

5199-
for (auto req : proto->getRequirementSignature().getRequirements()) {
5200-
if (req.getKind() == RequirementKind::Conformance) {
5201-
auto depTy = req.getFirstType();
5202-
auto *proto = req.getProtocolDecl();
5199+
Conformance->forEachAssociatedConformance(
5200+
[&](Type depTy, ProtocolDecl *proto, unsigned index) {
52035201
auto conformance = Conformance->getAssociatedConformance(depTy, proto);
52045202
if (conformance.isConcrete()) {
52055203
auto *concrete = conformance.getConcrete();
@@ -5208,8 +5206,9 @@ void ConformanceChecker::ensureRequirementsAreSatisfied() {
52085206
conformance, where,
52095207
depTy, replacementTy);
52105208
}
5211-
}
5212-
}
5209+
5210+
return false;
5211+
});
52135212
}
52145213

52155214
#pragma mark Protocol conformance checking

0 commit comments

Comments
 (0)