@@ -582,33 +582,14 @@ TypeSubstituter::transformLocalArchetypeType(LocalArchetypeType *local,
582
582
if (!IFS.shouldSubstituteLocalArchetypes ())
583
583
return std::nullopt;
584
584
585
- // If we have a substitution for this type, use it.
586
- if (auto known = IFS.substType (local, level))
587
- return known;
585
+ auto known = IFS.substType (local, level);
588
586
589
587
// FIXME: Change remaining callers to always substitute all local
590
588
// archetypes.
591
- if (local-> isRoot () )
589
+ if (!known )
592
590
return Type (local);
593
591
594
- // For nested archetypes, we can substitute the parent.
595
- Type origParent = local->getParent ();
596
- assert (origParent && " Not a nested archetype" );
597
-
598
- // Substitute into the parent type.
599
- Type substParent = doIt (origParent, TypePosition::Invariant);
600
-
601
- // If the parent didn't change, we won't change.
602
- if (substParent.getPointer () == origParent.getPointer ())
603
- return Type (local);
604
-
605
- // Get the associated type reference from a child archetype.
606
- AssociatedTypeDecl *assocType = local->getInterfaceType ()
607
- ->castTo <DependentMemberType>()->getAssocType ();
608
-
609
- return getMemberForBaseType (IFS, origParent, substParent,
610
- assocType, assocType->getName (),
611
- level);
592
+ return known;
612
593
}
613
594
614
595
Type TypeSubstituter::transformGenericTypeParamType (GenericTypeParamType *param,
0 commit comments