-
Notifications
You must be signed in to change notification settings - Fork 10.5k
AST: rename OpenArchetypeType -> ExistentialArchetypeType #79917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eeckstein
merged 1 commit into
swiftlang:main
from
eeckstein:rename-opened-archetype-type
Mar 12, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ class GenericSignatureBuilder; | |
class Identifier; | ||
class InOutType; | ||
class OpaqueTypeDecl; | ||
class OpenedArchetypeType; | ||
class ExistentialArchetypeType; | ||
class PackExpansionType; | ||
class PackType; | ||
enum class ParamSpecifier : uint8_t; | ||
|
@@ -114,6 +114,9 @@ enum class TypeKind : uint8_t { | |
#define TYPE_RANGE(Id, FirstId, LastId) \ | ||
First_##Id##Type = FirstId, Last_##Id##Type = LastId, | ||
#include "swift/AST/TypeNodes.def" | ||
// For backward compatibility in LLDB sources. | ||
// TODO: remove this once OpenedArchetype is renamed in LLDB sources. | ||
OpenedArchetype = ExistentialArchetype | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also update lldb at the same time and do a cross-repo test |
||
}; | ||
|
||
enum : unsigned { | ||
|
@@ -6971,16 +6974,16 @@ class LocalArchetypeType : public ArchetypeType { | |
|
||
public: | ||
static bool classof(const TypeBase *type) { | ||
return type->getKind() == TypeKind::OpenedArchetype || | ||
return type->getKind() == TypeKind::ExistentialArchetype || | ||
type->getKind() == TypeKind::ElementArchetype; | ||
} | ||
}; | ||
BEGIN_CAN_TYPE_WRAPPER(LocalArchetypeType, ArchetypeType) | ||
END_CAN_TYPE_WRAPPER(LocalArchetypeType, ArchetypeType) | ||
|
||
/// An archetype that represents the dynamic type of an opened existential. | ||
class OpenedArchetypeType final : public LocalArchetypeType, | ||
private ArchetypeTrailingObjects<OpenedArchetypeType> | ||
class ExistentialArchetypeType final : public LocalArchetypeType, | ||
private ArchetypeTrailingObjects<ExistentialArchetypeType> | ||
{ | ||
friend TrailingObjects; | ||
friend ArchetypeType; | ||
|
@@ -6991,7 +6994,7 @@ class OpenedArchetypeType final : public LocalArchetypeType, | |
/// | ||
/// This is only invoked by the generic environment when mapping the | ||
/// interface type into context. | ||
static CanTypeWrapper<OpenedArchetypeType> | ||
static CanTypeWrapper<ExistentialArchetypeType> | ||
getNew(GenericEnvironment *environment, Type interfaceType, | ||
ArrayRef<ProtocolDecl *> conformsTo, Type superclass, | ||
LayoutConstraint layout); | ||
|
@@ -7001,7 +7004,7 @@ class OpenedArchetypeType final : public LocalArchetypeType, | |
/// of an existential value. | ||
/// | ||
/// \param existential The existential type to open. | ||
static CanTypeWrapper<OpenedArchetypeType> get(CanType existential); | ||
static CanTypeWrapper<ExistentialArchetypeType> get(CanType existential); | ||
|
||
/// Create a new archetype that represents the opened type | ||
/// of an existential value. | ||
|
@@ -7014,18 +7017,18 @@ class OpenedArchetypeType final : public LocalArchetypeType, | |
static Type getAny(Type existential); | ||
|
||
static bool classof(const TypeBase *T) { | ||
return T->getKind() == TypeKind::OpenedArchetype; | ||
return T->getKind() == TypeKind::ExistentialArchetype; | ||
} | ||
|
||
private: | ||
OpenedArchetypeType(GenericEnvironment *environment, Type interfaceType, | ||
ExistentialArchetypeType(GenericEnvironment *environment, Type interfaceType, | ||
ArrayRef<ProtocolDecl *> conformsTo, | ||
Type superclass, | ||
LayoutConstraint layout, | ||
RecursiveTypeProperties properties); | ||
}; | ||
BEGIN_CAN_TYPE_WRAPPER(OpenedArchetypeType, LocalArchetypeType) | ||
END_CAN_TYPE_WRAPPER(OpenedArchetypeType, LocalArchetypeType) | ||
BEGIN_CAN_TYPE_WRAPPER(ExistentialArchetypeType, LocalArchetypeType) | ||
END_CAN_TYPE_WRAPPER(ExistentialArchetypeType, LocalArchetypeType) | ||
|
||
/// A wrapper around a shape type to use in ArchetypeTrailingObjects | ||
/// for PackArchetypeType. | ||
|
@@ -7111,7 +7114,7 @@ const Type *ArchetypeType::getSubclassTrailingObjects() const { | |
if (auto opaqueTy = dyn_cast<OpaqueTypeArchetypeType>(this)) { | ||
return opaqueTy->getTrailingObjects<Type>(); | ||
} | ||
if (auto openedTy = dyn_cast<OpenedArchetypeType>(this)) { | ||
if (auto openedTy = dyn_cast<ExistentialArchetypeType>(this)) { | ||
return openedTy->getTrailingObjects<Type>(); | ||
} | ||
if (auto childTy = dyn_cast<PackArchetypeType>(this)) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn’t have to update this, but thanks! There’s a whole unfinished chapter on existential types I’ll get around to finishing some day…