@@ -2753,54 +2753,6 @@ class PoundDiagnosticDecl : public Decl {
27532753
27542754class OpaqueTypeDecl ;
27552755
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-
28042756// / ValueDecl - All named decls that are values in the language. These can
28052757// / have a type, etc.
28062758class ValueDecl : public Decl {
@@ -3334,9 +3286,6 @@ class ValueDecl : public Decl {
33343286 // / @_dynamicReplacement(for: ...), compute the original declaration
33353287 // / that this declaration dynamically replaces.
33363288 ValueDecl *getDynamicallyReplacedDecl () const ;
3337-
3338- // / Find references to 'Self' in the type signature of this declaration.
3339- GenericParameterReferenceInfo findExistentialSelfReferences () const ;
33403289};
33413290
33423291// / This is a common base class for declarations which declare a type.
@@ -9517,17 +9466,6 @@ class MacroExpansionDecl : public Decl, public FreestandingMacroExpansion {
95179466 }
95189467};
95199468
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-
95319469inline void
95329470AbstractStorageDecl::overwriteSetterAccess (AccessLevel accessLevel) {
95339471 Accessors.setInt (accessLevel);
0 commit comments