@@ -404,12 +404,11 @@ GenericEnvironment::maybeApplyOuterContextSubstitutions(Type type) const {
404404
405405Type GenericEnvironment::mapTypeIntoContext (GenericEnvironment *env,
406406 Type type) {
407- assert ((!type->hasArchetype () || type->hasLocalArchetype ()) &&
408- " already have a contextual type" );
409- assert ((env || !type->hasTypeParameter ()) &&
410- " no generic environment provided for type with type parameters" );
407+ assert (!type->hasPrimaryArchetype () && " already have a contextual type" );
411408
412409 if (!env) {
410+ assert (!type->hasTypeParameter () &&
411+ " no generic environment provided for type with type parameters" );
413412 return type;
414413 }
415414
@@ -632,8 +631,7 @@ Type QueryInterfaceTypeSubstitutions::operator()(SubstitutableType *type) const{
632631Type GenericEnvironment::mapTypeIntoContext (
633632 Type type,
634633 LookupConformanceFn lookupConformance) const {
635- assert ((!type->hasArchetype () || type->hasLocalArchetype ()) &&
636- " already have a contextual type" );
634+ assert (!type->hasPrimaryArchetype () && " already have a contextual type" );
637635
638636 Type result = type.subst (QueryInterfaceTypeSubstitutions (this ),
639637 lookupConformance,
@@ -668,7 +666,7 @@ GenericEnvironment::mapContextualPackTypeIntoElementContext(Type type) const {
668666 assert (getKind () == Kind::OpenedElement);
669667 assert (!type->hasTypeParameter () && " expected contextual type" );
670668
671- if (!type->hasArchetype ()) return type;
669+ if (!type->hasPackArchetype ()) return type;
672670
673671 auto sig = getGenericSignature ();
674672 auto shapeClass = getOpenedElementShapeClass ();
@@ -698,9 +696,9 @@ GenericEnvironment::mapContextualPackTypeIntoElementContext(CanType type) const
698696Type
699697GenericEnvironment::mapPackTypeIntoElementContext (Type type) const {
700698 assert (getKind () == Kind::OpenedElement);
701- assert (!type->hasArchetype ());
699+ assert (!type->hasPackArchetype ());
702700
703- if (!type->hasTypeParameter ()) return type;
701+ if (!type->hasParameterPack ()) return type;
704702
705703 // Get a contextual type in the original generic environment, not the
706704 // substituted one, which is what mapContextualPackTypeIntoElementContext()
0 commit comments