@@ -6688,8 +6688,7 @@ NominalTypeDecl::hasInverseMarking(InvertibleProtocolKind target) const {
6688
6688
if (isa<BuiltinTupleDecl>(this ))
6689
6689
return InverseMarking::Mark (InverseMarking::Kind::Explicit);
6690
6690
6691
- if (auto P = dyn_cast<ProtocolDecl>(this ))
6692
- return P->hasInverseMarking (target);
6691
+ assert (!isa<ProtocolDecl>(this ));
6693
6692
6694
6693
// Search the inheritance clause first.
6695
6694
if (auto inverse = findInverseInInheritance (getInherited (), target))
@@ -6698,41 +6697,6 @@ NominalTypeDecl::hasInverseMarking(InvertibleProtocolKind target) const {
6698
6697
return InverseMarking::Mark ();
6699
6698
}
6700
6699
6701
- InverseMarking::Mark
6702
- ProtocolDecl::hasInverseMarking (InvertibleProtocolKind target) const {
6703
- auto &ctx = getASTContext ();
6704
-
6705
- // Legacy support stops here.
6706
- if (!ctx.LangOpts .hasFeature (Feature::NoncopyableGenerics))
6707
- return InverseMarking::Mark ();
6708
-
6709
- if (auto inverse = findInverseInInheritance (getInherited (), target))
6710
- return inverse;
6711
-
6712
- auto *whereClause = getTrailingWhereClause ();
6713
- if (!whereClause)
6714
- return InverseMarking::Mark ();
6715
-
6716
- for (const auto &reqRepr : whereClause->getRequirements ()) {
6717
- if (reqRepr.isInvalid () ||
6718
- reqRepr.getKind () != RequirementReprKind::TypeConstraint)
6719
- continue ;
6720
-
6721
- auto *subjectRepr =
6722
- dyn_cast<UnqualifiedIdentTypeRepr>(reqRepr.getSubjectRepr ());
6723
- auto *constraintRepr = reqRepr.getConstraintRepr ();
6724
-
6725
- if (!subjectRepr || !subjectRepr->getNameRef ().isSimpleName (ctx.Id_Self ))
6726
- continue ;
6727
-
6728
- if (constraintRepr->isInverseOf (target, getDeclContext ()))
6729
- return InverseMarking::Mark (InverseMarking::Kind::Explicit,
6730
- constraintRepr->getLoc ());
6731
- }
6732
-
6733
- return InverseMarking::Mark ();
6734
- }
6735
-
6736
6700
bool ProtocolDecl::requiresClass () const {
6737
6701
return evaluateOrDefault (getASTContext ().evaluator ,
6738
6702
ProtocolRequiresClassRequest{const_cast <ProtocolDecl *>(this )}, false );
0 commit comments