@@ -6790,42 +6790,6 @@ ProtocolDecl::hasInverseMarking(InvertibleProtocolKind target) const {
67906790 return InverseMarking::Mark ();
67916791}
67926792
6793- bool ProtocolDecl::requiresInvertible (InvertibleProtocolKind ip) const {
6794- // Protocols don't inherit from themselves.
6795- if (auto thisIP = getInvertibleProtocolKind ()) {
6796- if (thisIP == ip)
6797- return false ;
6798- }
6799-
6800- auto kp = ::getKnownProtocolKind (ip);
6801-
6802- // Otherwise, check for inverses on all of the inherited protocols. If there
6803- // is one protocol missing an inverse for this `super` protocol, then it is
6804- // implicitly inherited.
6805- return walkInheritedProtocols ([kp, ip](ProtocolDecl *proto) {
6806- if (proto->isSpecificProtocol (kp))
6807- return TypeWalker::Action::Stop; // It is explicitly inherited.
6808-
6809- // There is no implicit inheritance of an invertible protocol requirement
6810- // on an invertible protocol itself.
6811- if (proto->getInvertibleProtocolKind ())
6812- return TypeWalker::Action::Continue;
6813-
6814- // HACK: claim that Sendable also doesn't implicitly inherit Copyable, etc.
6815- // This shouldn't be needed after Swift 6.0
6816- if (proto->isSpecificProtocol (KnownProtocolKind::Sendable))
6817- return TypeWalker::Action::Continue;
6818-
6819- // Otherwise, check to see if there's an inverse on this protocol.
6820-
6821- // The implicit requirement was suppressed on this protocol, keep looking.
6822- if (proto->hasInverseMarking (ip))
6823- return TypeWalker::Action::Continue;
6824-
6825- return TypeWalker::Action::Stop; // No inverse, so implicitly inherited.
6826- });
6827- }
6828-
68296793bool ProtocolDecl::requiresClass () const {
68306794 return evaluateOrDefault (getASTContext ().evaluator ,
68316795 ProtocolRequiresClassRequest{const_cast <ProtocolDecl *>(this )}, false );
0 commit comments