Merge pull request #71821 from slavapestov/inheritance-clause-fixes

Refactor protocol inheritance clauses and existential layout for non-copyable generics
This commit is contained in:
Slava Pestov
2024-02-24 11:58:03 -05:00
committed by GitHub
54 changed files with 715 additions and 703 deletions

View File

@@ -4389,10 +4389,6 @@ public:
/// Type if it `isEscapable` instead of using this.
CanBeInvertible::Result canBeEscapable() const;
/// Determine whether this type has `: <target>` stated explicitly in
/// its inheritance clause.
bool hasMarking(InvertibleProtocolKind target) const;
/// Determine whether this type has ~<target>` stated on
/// itself, one of its inherited types or `Self` requirements.
InverseMarking::Mark hasInverseMarking(InvertibleProtocolKind target) const;
@@ -5188,6 +5184,10 @@ public:
/// Retrieve the set of protocols inherited from this protocol.
ArrayRef<ProtocolDecl *> getInheritedProtocols() const;
/// Retrieve the transitive closure of the inherited protocols, not including
/// this protocol itself.
ArrayRef<ProtocolDecl *> getAllInheritedProtocols() const;
/// Determine whether this protocol has a superclass.
bool hasSuperclass() const { return (bool)getSuperclassDecl(); }
@@ -5255,10 +5255,6 @@ public:
/// Determine whether this protocol has ~<target>` stated on
/// itself, one of its inherited types or `Self` requirements.
InverseMarking::Mark hasInverseMarking(InvertibleProtocolKind target) const;
/// Determine whether this protocol requires conformance to `IP`, without
/// querying a generic signature.
bool requiresInvertible(InvertibleProtocolKind ip) const;
SourceLoc getStartLoc() const { return ProtocolLoc; }
SourceRange getSourceRange() const {