mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously we had two separate mechanisms to turn a metatype into a string. The swift_typeName() function was used to print the metatype in a human-readable fashion, whereas the _swift_buildDemanglingForMetadata() was used when naming generated generic Objective-C classes. Unify them, since what swift_typeName() does is redundant; instead of going directly from the metatype to a human-readable string, we can get the mangling, and print that using the demangler. This fixes some issues with unnecessary parenthesis when printing function types, and also allows Objective-C classes to be instantiated with nested generic types as parameters.
4.5 KiB
4.5 KiB