@@ -3322,9 +3322,7 @@ TypeAliasType *TypeAliasType::get(TypeAliasDecl *typealias, Type parent,
3322
3322
auto properties = underlying->getRecursiveProperties();
3323
3323
if (parent)
3324
3324
properties |= parent->getRecursiveProperties();
3325
-
3326
- for (auto substGP : substitutions.getReplacementTypes())
3327
- properties |= substGP->getRecursiveProperties();
3325
+ properties |= substitutions.getRecursiveProperties();
3328
3326
3329
3327
// Figure out which arena this type will go into.
3330
3328
auto &ctx = underlying->getASTContext();
@@ -4936,7 +4934,7 @@ SILFunctionType::SILFunctionType(
4936
4934
}
4937
4935
4938
4936
if (genericSig && patternSubs) {
4939
- assert(!patternSubs.hasArchetypes ()
4937
+ assert(!patternSubs.getRecursiveProperties().hasArchetype ()
4940
4938
&& "pattern substitutions should not contain context archetypes");
4941
4939
}
4942
4940
}
@@ -5093,9 +5091,7 @@ CanSILFunctionType SILFunctionType::get(
5093
5091
}
5094
5092
5095
5093
auto outerSubs = genericSig ? invocationSubs : patternSubs;
5096
- for (auto replacement : outerSubs.getReplacementTypes()) {
5097
- properties |= replacement->getRecursiveProperties();
5098
- }
5094
+ properties |= outerSubs.getRecursiveProperties();
5099
5095
5100
5096
auto fnType =
5101
5097
new (mem) SILFunctionType(genericSig, ext, coroutineKind, callee,
@@ -5282,15 +5278,9 @@ DependentMemberType *DependentMemberType::get(Type base,
5282
5278
/// Compute the recursive type properties of an opaque type archetype.
5283
5279
static RecursiveTypeProperties getOpaqueTypeArchetypeProperties(
5284
5280
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.
5289
5281
RecursiveTypeProperties properties =
5290
5282
RecursiveTypeProperties::HasOpaqueArchetype;
5291
- for (auto type : subs.getReplacementTypes()) {
5292
- properties |= type->getRecursiveProperties();
5293
- }
5283
+ properties |= subs.getRecursiveProperties();
5294
5284
return properties;
5295
5285
}
5296
5286
@@ -5317,17 +5307,11 @@ Type OpaqueTypeArchetypeType::get(
5317
5307
return env->getOrCreateArchetypeFromInterfaceType(interfaceType);
5318
5308
}
5319
5309
5320
- /// Compute the recursive type properties of an opaque type archetype.
5310
+ /// Compute the recursive type properties of an opened existential archetype.
5321
5311
static 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.
5326
5312
RecursiveTypeProperties properties =
5327
5313
RecursiveTypeProperties::HasOpenedExistential;
5328
- for (auto type : subs.getReplacementTypes()) {
5329
- properties |= type->getRecursiveProperties();
5330
- }
5314
+ properties |= subs.getRecursiveProperties();
5331
5315
return properties;
5332
5316
}
5333
5317
0 commit comments