mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Push ArchetypeType's API down to subclasses.
And clean up code that conditionally works only with certain kinds of archetype along the way.
This commit is contained in:
@@ -3350,10 +3350,8 @@ namespace {
|
||||
Type type = CS.getType(expr);
|
||||
if (type->hasOpenedExistential()) {
|
||||
type = type.transform([&](Type type) -> Type {
|
||||
if (auto archetype = type->getAs<ArchetypeType>())
|
||||
if (auto existentialType = archetype->getOpenedExistentialType())
|
||||
return existentialType;
|
||||
|
||||
if (auto archetype = type->getAs<OpenedArchetypeType>())
|
||||
return archetype->getOpenedExistentialType();
|
||||
return type;
|
||||
});
|
||||
CS.setType(expr, type);
|
||||
|
||||
Reference in New Issue
Block a user