Skip to content

Commit 9f0564c

Browse files
committed
AST: Replace a ProtocolDecl::requiresInvertible() call with ProtocolDecl::inheritsFrom()
1 parent 61ecdea commit 9f0564c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4923,10 +4923,11 @@ conformanceExists(TypeDecl const *decl, InvertibleProtocolKind ip) {
49234923
assert(proto && "missing Copyable/Escapable from stdlib!");
49244924

49254925
// Handle protocols specially, without building a GenericSignature.
4926-
if (auto *protoDecl = dyn_cast<ProtocolDecl>(decl))
4927-
return protoDecl->requiresInvertible(ip)
4926+
if (auto *protoDecl = dyn_cast<ProtocolDecl>(decl)) {
4927+
return protoDecl->inheritsFrom(proto)
49284928
? TypeDecl::CanBeInvertible::Always
49294929
: TypeDecl::CanBeInvertible::Never;
4930+
}
49304931

49314932
Type selfTy = decl->getDeclaredInterfaceType();
49324933
assert(selfTy);

0 commit comments

Comments
 (0)