Skip to content

Commit 665faf5

Browse files
committed
AST: Remove unnecessary superclass bound check in SubstitutionMap::lookupConformance()
1 parent d33bd9f commit 665faf5

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,6 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
359359
if (auto directConformance = getSignatureConformance(type, proto))
360360
return *directConformance;
361361

362-
// Check whether the superclass conforms.
363-
if (auto superclass = genericSig->getSuperclassBound(type)) {
364-
LookUpConformanceInSignature lookup(getGenericSignature().getPointer());
365-
auto substType = type.subst(*this);
366-
if (auto conformance = lookup(type->getCanonicalType(), substType, proto)){
367-
return conformance;
368-
}
369-
}
370-
371362
// If the type doesn't conform to this protocol, the result isn't formed
372363
// from these requirements.
373364
if (!genericSig->requiresProtocol(type, proto)) {
@@ -378,7 +369,6 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
378369
auto accessPath =
379370
genericSig->getConformanceAccessPath(type, proto);
380371

381-
// Fall through because we cannot yet evaluate an access path.
382372
ProtocolConformanceRef conformance;
383373
for (const auto &step : accessPath) {
384374
// For the first step, grab the initial conformance.

0 commit comments

Comments
 (0)