mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Give opened archetypes a generic environment.
And maybe allow nested types to live on them.
This commit is contained in:
@@ -1036,7 +1036,9 @@ shouldBePartiallySpecialized(Type Replacement,
|
||||
llvm::SmallSetVector<ArchetypeType *, 2> UsedArchetypes;
|
||||
Replacement.visit([&](Type Ty) {
|
||||
if (auto Archetype = Ty->getAs<ArchetypeType>()) {
|
||||
UsedArchetypes.insert(Archetype->getPrimary());
|
||||
if (auto Primary = dyn_cast<PrimaryArchetypeType>(Archetype->getRoot())) {
|
||||
UsedArchetypes.insert(Primary);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1264,7 +1266,9 @@ void FunctionSignaturePartialSpecializer::collectUsedCallerArchetypes(
|
||||
// Add used generic parameters/archetypes.
|
||||
Replacement.visit([&](Type Ty) {
|
||||
if (auto Archetype = Ty->getAs<ArchetypeType>()) {
|
||||
UsedCallerArchetypes.insert(Archetype->getPrimary());
|
||||
if (auto Primary = dyn_cast<PrimaryArchetypeType>(Archetype->getRoot())) {
|
||||
UsedCallerArchetypes.insert(Primary);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user