@@ -184,7 +184,6 @@ bool CanType::isReferenceTypeImpl(CanType type, const GenericSignatureImpl *sig,
184184 // Archetypes and existentials are only class references if class-bounded.
185185 case TypeKind::PrimaryArchetype:
186186 case TypeKind::OpenedArchetype:
187- case TypeKind::NestedArchetype:
188187 case TypeKind::OpaqueTypeArchetype:
189188 case TypeKind::SequenceArchetype:
190189 return cast<ArchetypeType>(type)->requiresClass ();
@@ -3281,20 +3280,6 @@ Type OpenedArchetypeType::getOpenedExistentialType() const {
32813280 return getGenericEnvironment ()->getOpenedExistentialType ();
32823281}
32833282
3284- NestedArchetypeType::NestedArchetypeType (const ASTContext &Ctx,
3285- Type InterfaceType,
3286- ArrayRef<ProtocolDecl *> ConformsTo,
3287- Type Superclass,
3288- LayoutConstraint Layout,
3289- GenericEnvironment *Environment)
3290- : ArchetypeType(TypeKind::NestedArchetype, Ctx,
3291- Environment->mapTypeIntoContext (
3292- InterfaceType->getRootGenericParam ())
3293- ->getRecursiveProperties(),
3294- InterfaceType, ConformsTo, Superclass, Layout, Environment)
3295- {
3296- }
3297-
32983283OpaqueTypeArchetypeType::OpaqueTypeArchetypeType (
32993284 GenericEnvironment *environment,
33003285 RecursiveTypeProperties properties,
@@ -3601,28 +3586,6 @@ operator()(CanType maybeOpaqueType, Type replacementType,
36013586 return substRef;
36023587}
36033588
3604- CanNestedArchetypeType NestedArchetypeType::getNew (
3605- const ASTContext &Ctx,
3606- DependentMemberType *InterfaceType,
3607- SmallVectorImpl<ProtocolDecl *> &ConformsTo,
3608- Type Superclass,
3609- LayoutConstraint Layout,
3610- GenericEnvironment *Environment) {
3611- assert (!Superclass || Superclass->getClassOrBoundGenericClass ());
3612-
3613- // Gather the set of protocol declarations to which this archetype conforms.
3614- ProtocolType::canonicalizeProtocols (ConformsTo);
3615-
3616- auto arena = AllocationArena::Permanent;
3617- void *mem = Ctx.Allocate (
3618- NestedArchetypeType::totalSizeToAlloc<ProtocolDecl *, Type, LayoutConstraint>(
3619- ConformsTo.size (), Superclass ? 1 : 0 , Layout ? 1 : 0 ),
3620- alignof (NestedArchetypeType), arena);
3621-
3622- return CanNestedArchetypeType (::new (mem) NestedArchetypeType (
3623- Ctx, InterfaceType, ConformsTo, Superclass, Layout, Environment));
3624- }
3625-
36263589CanPrimaryArchetypeType
36273590PrimaryArchetypeType::getNew (const ASTContext &Ctx,
36283591 GenericEnvironment *GenericEnv,
@@ -3719,10 +3682,6 @@ Type ArchetypeType::getNestedTypeByName(Identifier name) {
37193682 return Type ();
37203683}
37213684
3722- AssociatedTypeDecl *NestedArchetypeType::getAssocType () const {
3723- return InterfaceType->castTo <DependentMemberType>()->getAssocType ();
3724- }
3725-
37263685Identifier ArchetypeType::getName () const {
37273686 assert (InterfaceType);
37283687 if (auto depMemTy = InterfaceType->getAs <DependentMemberType>())
@@ -4929,22 +4888,6 @@ case TypeKind::Id:
49294888 opaque->getInterfaceType (),
49304889 newSubMap);
49314890 }
4932- case TypeKind::NestedArchetype: {
4933- // Transform the root type of a nested opaque archetype.
4934- auto nestedType = cast<NestedArchetypeType>(base);
4935- auto root = dyn_cast<OpaqueTypeArchetypeType>(nestedType->getRoot ());
4936- if (!root)
4937- return *this ;
4938-
4939- auto substRoot = Type (root).transformRec (fn);
4940- if (substRoot.getPointer () == root) {
4941- return *this ;
4942- }
4943-
4944- // Substitute the new root into the root of the interface type.
4945- return nestedType->getInterfaceType ()->substRootParam (substRoot,
4946- LookUpConformanceInModule (root->getDecl ()->getModuleContext ()));
4947- }
49484891
49494892 case TypeKind::ExistentialMetatype: {
49504893 auto meta = cast<ExistentialMetatypeType>(base);
@@ -5568,7 +5511,6 @@ ReferenceCounting TypeBase::getReferenceCounting() {
55685511
55695512 case TypeKind::PrimaryArchetype:
55705513 case TypeKind::OpenedArchetype:
5571- case TypeKind::NestedArchetype:
55725514 case TypeKind::OpaqueTypeArchetype:
55735515 case TypeKind::SequenceArchetype: {
55745516 auto archetype = cast<ArchetypeType>(type);
0 commit comments