@@ -3322,9 +3322,7 @@ TypeAliasType *TypeAliasType::get(TypeAliasDecl *typealias, Type parent,
33223322 auto properties = underlying->getRecursiveProperties ();
33233323 if (parent)
33243324 properties |= parent->getRecursiveProperties ();
3325-
3326- for (auto substGP : substitutions.getReplacementTypes ())
3327- properties |= substGP->getRecursiveProperties ();
3325+ properties |= substitutions.getRecursiveProperties ();
33283326
33293327 // Figure out which arena this type will go into.
33303328 auto &ctx = underlying->getASTContext ();
@@ -4936,7 +4934,7 @@ SILFunctionType::SILFunctionType(
49364934 }
49374935
49384936 if (genericSig && patternSubs) {
4939- assert (!patternSubs.hasArchetypes ()
4937+ assert (!patternSubs.getRecursiveProperties (). hasArchetype ()
49404938 && " pattern substitutions should not contain context archetypes" );
49414939 }
49424940 }
@@ -5093,9 +5091,7 @@ CanSILFunctionType SILFunctionType::get(
50935091 }
50945092
50955093 auto outerSubs = genericSig ? invocationSubs : patternSubs;
5096- for (auto replacement : outerSubs.getReplacementTypes ()) {
5097- properties |= replacement->getRecursiveProperties ();
5098- }
5094+ properties |= outerSubs.getRecursiveProperties ();
50995095
51005096 auto fnType =
51015097 new (mem) SILFunctionType (genericSig, ext, coroutineKind, callee,
@@ -5282,15 +5278,9 @@ DependentMemberType *DependentMemberType::get(Type base,
52825278// / Compute the recursive type properties of an opaque type archetype.
52835279static RecursiveTypeProperties getOpaqueTypeArchetypeProperties (
52845280 SubstitutionMap subs) {
5285- // An opaque type isn't contextually dependent like other archetypes, so
5286- // by itself, it doesn't impose the "Has Archetype" recursive property,
5287- // but the substituted types might. A disjoint "Has Opaque Archetype" tracks
5288- // the presence of opaque archetypes.
52895281 RecursiveTypeProperties properties =
52905282 RecursiveTypeProperties::HasOpaqueArchetype;
5291- for (auto type : subs.getReplacementTypes ()) {
5292- properties |= type->getRecursiveProperties ();
5293- }
5283+ properties |= subs.getRecursiveProperties ();
52945284 return properties;
52955285}
52965286
@@ -5317,17 +5307,11 @@ Type OpaqueTypeArchetypeType::get(
53175307 return env->getOrCreateArchetypeFromInterfaceType (interfaceType);
53185308}
53195309
5320- // / Compute the recursive type properties of an opaque type archetype.
5310+ // / Compute the recursive type properties of an opened existential archetype.
53215311static RecursiveTypeProperties getOpenedArchetypeProperties (SubstitutionMap subs) {
5322- // An opaque type isn't contextually dependent like other archetypes, so
5323- // by itself, it doesn't impose the "Has Archetype" recursive property,
5324- // but the substituted types might. A disjoint "Has Opaque Archetype" tracks
5325- // the presence of opaque archetypes.
53265312 RecursiveTypeProperties properties =
53275313 RecursiveTypeProperties::HasOpenedExistential;
5328- for (auto type : subs.getReplacementTypes ()) {
5329- properties |= type->getRecursiveProperties ();
5330- }
5314+ properties |= subs.getRecursiveProperties ();
53315315 return properties;
53325316}
53335317
0 commit comments