Split subclasses out of ArchetypeType.

Context archetypes and opened existential archetypes differ in a number of details, and this simplifies the overlapping storage of the kind-specific fields. This should be NFC; for now, this doesn't change the interface of ArchetypeType, but should allow some refinements of how the special handling of certain archetypes are handled.
This commit is contained in:
Joe Groff
2018-12-11 20:22:24 -08:00
parent 7732b984bd
commit f1648a1b3e
13 changed files with 295 additions and 138 deletions

View File

@@ -1896,7 +1896,9 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
return formUnsolvedResult();
case TypeKind::TypeVariable:
case TypeKind::Archetype:
case TypeKind::PrimaryArchetype:
case TypeKind::OpenedArchetype:
case TypeKind::NestedArchetype:
// Nothing to do here; handle type variables and archetypes below.
break;
@@ -2608,7 +2610,9 @@ ConstraintSystem::simplifyConstructionConstraint(
case TypeKind::BoundGenericClass:
case TypeKind::BoundGenericEnum:
case TypeKind::BoundGenericStruct:
case TypeKind::Archetype:
case TypeKind::PrimaryArchetype:
case TypeKind::OpenedArchetype:
case TypeKind::NestedArchetype:
case TypeKind::DynamicSelf:
case TypeKind::ProtocolComposition:
case TypeKind::Protocol: