@@ -5336,19 +5336,14 @@ CanTypeWrapper<OpenedArchetypeType> OpenedArchetypeType::getNew(
5336
5336
properties));
5337
5337
}
5338
5338
5339
- CanTypeWrapper<OpenedArchetypeType>
5340
- OpenedArchetypeType::get (CanType existential, std::optional<UUID> knownID) {
5341
- assert (existential->isExistentialType ());
5342
- auto interfaceType = OpenedArchetypeType::getSelfInterfaceTypeFromContext (
5343
- GenericSignature (), existential->getASTContext ());
5344
- return get (existential, interfaceType, knownID);
5345
- }
5346
-
5347
5339
CanOpenedArchetypeType OpenedArchetypeType::get (CanType existential,
5348
- Type interfaceType,
5349
5340
std::optional<UUID> knownID) {
5341
+ assert (existential->isExistentialType ());
5350
5342
assert (!existential->hasTypeParameter ());
5351
5343
5344
+ auto interfaceType = OpenedArchetypeType::getSelfInterfaceTypeFromContext (
5345
+ GenericSignature (), existential->getASTContext ());
5346
+
5352
5347
if (!knownID)
5353
5348
knownID = UUID::fromTime ();
5354
5349
@@ -5362,28 +5357,20 @@ CanOpenedArchetypeType OpenedArchetypeType::get(CanType existential,
5362
5357
return CanOpenedArchetypeType (result);
5363
5358
}
5364
5359
5365
- Type OpenedArchetypeType::getAny (Type existential, Type interfaceTy ) {
5360
+ Type OpenedArchetypeType::getAny (Type existential) {
5366
5361
assert (existential->isAnyExistentialType ());
5362
+
5367
5363
if (auto metatypeTy = existential->getAs <ExistentialMetatypeType>()) {
5368
- auto instanceTy =
5369
- metatypeTy->getExistentialInstanceType ()->getCanonicalType ();
5370
- auto openedInstanceTy = OpenedArchetypeType::getAny (
5371
- instanceTy, interfaceTy);
5364
+ auto instanceTy = metatypeTy->getExistentialInstanceType ();
5365
+ auto openedInstanceTy = OpenedArchetypeType::getAny (instanceTy);
5372
5366
if (metatypeTy->hasRepresentation ()) {
5373
5367
return MetatypeType::get (openedInstanceTy,
5374
5368
metatypeTy->getRepresentation ());
5375
5369
}
5376
5370
return MetatypeType::get (openedInstanceTy);
5377
5371
}
5378
- assert (existential->isExistentialType ());
5379
- return OpenedArchetypeType::get (existential->getCanonicalType (),
5380
- interfaceTy);
5381
- }
5382
5372
5383
- Type OpenedArchetypeType::getAny (Type existential) {
5384
- auto interfaceTy = OpenedArchetypeType::getSelfInterfaceTypeFromContext (
5385
- GenericSignature (), existential->getASTContext ());
5386
- return getAny (existential, interfaceTy);
5373
+ return OpenedArchetypeType::get (existential->getCanonicalType ());
5387
5374
}
5388
5375
5389
5376
void SubstitutionMap::Storage::Profile (
0 commit comments