@@ -404,12 +404,11 @@ GenericEnvironment::maybeApplyOuterContextSubstitutions(Type type) const {
404
404
405
405
Type GenericEnvironment::mapTypeIntoContext (GenericEnvironment *env,
406
406
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" );
411
408
412
409
if (!env) {
410
+ assert (!type->hasTypeParameter () &&
411
+ " no generic environment provided for type with type parameters" );
413
412
return type;
414
413
}
415
414
@@ -632,8 +631,7 @@ Type QueryInterfaceTypeSubstitutions::operator()(SubstitutableType *type) const{
632
631
Type GenericEnvironment::mapTypeIntoContext (
633
632
Type type,
634
633
LookupConformanceFn lookupConformance) const {
635
- assert ((!type->hasArchetype () || type->hasLocalArchetype ()) &&
636
- " already have a contextual type" );
634
+ assert (!type->hasPrimaryArchetype () && " already have a contextual type" );
637
635
638
636
Type result = type.subst (QueryInterfaceTypeSubstitutions (this ),
639
637
lookupConformance,
@@ -668,7 +666,7 @@ GenericEnvironment::mapContextualPackTypeIntoElementContext(Type type) const {
668
666
assert (getKind () == Kind::OpenedElement);
669
667
assert (!type->hasTypeParameter () && " expected contextual type" );
670
668
671
- if (!type->hasArchetype ()) return type;
669
+ if (!type->hasPackArchetype ()) return type;
672
670
673
671
auto sig = getGenericSignature ();
674
672
auto shapeClass = getOpenedElementShapeClass ();
@@ -698,9 +696,9 @@ GenericEnvironment::mapContextualPackTypeIntoElementContext(CanType type) const
698
696
Type
699
697
GenericEnvironment::mapPackTypeIntoElementContext (Type type) const {
700
698
assert (getKind () == Kind::OpenedElement);
701
- assert (!type->hasArchetype ());
699
+ assert (!type->hasPackArchetype ());
702
700
703
- if (!type->hasTypeParameter ()) return type;
701
+ if (!type->hasParameterPack ()) return type;
704
702
705
703
// Get a contextual type in the original generic environment, not the
706
704
// substituted one, which is what mapContextualPackTypeIntoElementContext()
0 commit comments