Skip to content

Commit 9224d8b

Browse files
committed
Sema: Remove unnecessary ProtocolDecl::getSuperclass() check
The condition that the conforming type satisfies the superclass bound of the conformed protocol is already covered by the conformance constraint itself.
1 parent b6e9579 commit 9224d8b

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,14 +4118,6 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
41184118
}
41194119

41204120
for (auto *protoDecl : layout.getProtocols()) {
4121-
if (auto superclass = protoDecl->getSuperclass()) {
4122-
auto subKind = std::min(ConstraintKind::Subtype, kind);
4123-
auto result = matchTypes(type1, superclass, subKind,
4124-
subflags, locator);
4125-
if (result.isFailure())
4126-
return result;
4127-
}
4128-
41294121
switch (simplifyConformsToConstraint(type1, protoDecl, kind, locator,
41304122
subflags)) {
41314123
case SolutionKind::Solved:

0 commit comments

Comments
 (0)