Merge pull request #67692 from artemcm/ConstExtractPrintTypesOutOfContext

[Compile Time Constant Extraction] Map types with archetypes out of context, before mangling them for printing.
This commit is contained in:
Artem Chikin
2023-08-03 11:08:58 -07:00
committed by GitHub
2 changed files with 40 additions and 1 deletions

View File

@@ -85,7 +85,10 @@ std::string toFullyQualifiedProtocolNameString(const swift::ProtocolDecl &Protoc
}
std::string toMangledTypeNameString(const swift::Type &Type) {
return Mangle::ASTMangler().mangleTypeWithoutPrefix(Type->getCanonicalType());
auto PrintingType = Type;
if (Type->hasArchetype())
PrintingType = Type->mapTypeOutOfContext();
return Mangle::ASTMangler().mangleTypeWithoutPrefix(PrintingType->getCanonicalType());
}
} // namespace