@@ -2753,54 +2753,6 @@ class PoundDiagnosticDecl : public Decl {
2753
2753
2754
2754
class OpaqueTypeDecl ;
2755
2755
2756
- // / Describes the least favorable positions at which a requirement refers
2757
- // / to a given generic parameter in terms of variance, for use in the
2758
- // / is-inheritable and is-available-existential checks.
2759
- class GenericParameterReferenceInfo final {
2760
- using OptionalTypePosition = OptionalEnum<decltype (TypePosition::Covariant)>;
2761
-
2762
- public:
2763
- // / Whether the uncurried interface type of the declaration, stripped of any
2764
- // / optionality, is a direct reference to the generic parameter at hand. For
2765
- // / example, "func foo(x: Int) -> () -> Self?" has a covariant 'Self' result.
2766
- bool hasCovariantSelfResult;
2767
-
2768
- OptionalTypePosition selfRef;
2769
- OptionalTypePosition assocTypeRef;
2770
-
2771
- // / A reference to 'Self'.
2772
- static GenericParameterReferenceInfo forSelfRef (TypePosition position) {
2773
- return GenericParameterReferenceInfo (false , position, std::nullopt);
2774
- }
2775
-
2776
- // / A reference to the generic parameter in covariant result position.
2777
- static GenericParameterReferenceInfo forCovariantResult () {
2778
- return GenericParameterReferenceInfo (true , TypePosition::Covariant,
2779
- std::nullopt);
2780
- }
2781
-
2782
- // / A reference to 'Self' through an associated type.
2783
- static GenericParameterReferenceInfo forAssocTypeRef (TypePosition position) {
2784
- return GenericParameterReferenceInfo (false , std::nullopt, position);
2785
- }
2786
-
2787
- GenericParameterReferenceInfo &operator |=(const GenericParameterReferenceInfo &other);
2788
-
2789
- explicit operator bool () const {
2790
- return hasCovariantSelfResult || selfRef || assocTypeRef;
2791
- }
2792
-
2793
- GenericParameterReferenceInfo ()
2794
- : hasCovariantSelfResult(false ), selfRef(std::nullopt),
2795
- assocTypeRef (std::nullopt) {}
2796
-
2797
- private:
2798
- GenericParameterReferenceInfo (bool hasCovariantSelfResult, OptionalTypePosition selfRef,
2799
- OptionalTypePosition assocTypeRef)
2800
- : hasCovariantSelfResult(hasCovariantSelfResult), selfRef(selfRef),
2801
- assocTypeRef(assocTypeRef) {}
2802
- };
2803
-
2804
2756
// / ValueDecl - All named decls that are values in the language. These can
2805
2757
// / have a type, etc.
2806
2758
class ValueDecl : public Decl {
@@ -3334,9 +3286,6 @@ class ValueDecl : public Decl {
3334
3286
// / @_dynamicReplacement(for: ...), compute the original declaration
3335
3287
// / that this declaration dynamically replaces.
3336
3288
ValueDecl *getDynamicallyReplacedDecl () const ;
3337
-
3338
- // / Find references to 'Self' in the type signature of this declaration.
3339
- GenericParameterReferenceInfo findExistentialSelfReferences () const ;
3340
3289
};
3341
3290
3342
3291
// / This is a common base class for declarations which declare a type.
@@ -9517,17 +9466,6 @@ class MacroExpansionDecl : public Decl, public FreestandingMacroExpansion {
9517
9466
}
9518
9467
};
9519
9468
9520
- // / Find references to the given generic parameter in the type signature of the
9521
- // / given declaration using the given generic signature.
9522
- // /
9523
- // / \param skipParamIndex If the value is a function or subscript declaration,
9524
- // / specifies the index of the parameter that shall be skipped.
9525
- GenericParameterReferenceInfo
9526
- findGenericParameterReferences (const ValueDecl *value, CanGenericSignature sig,
9527
- GenericTypeParamType *origParam,
9528
- GenericTypeParamType *openedParam,
9529
- std::optional<unsigned > skipParamIndex);
9530
-
9531
9469
inline void
9532
9470
AbstractStorageDecl::overwriteSetterAccess (AccessLevel accessLevel) {
9533
9471
Accessors.setInt (accessLevel);
0 commit comments