Cannot demangle Swift symbols

Number:rdar://39441521 Date Originated:15-Apr-2018 12:00 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2.2.1 to 4.1
Classification:Serious Bug Reproducible:Yes

I'm trying to de-mangle mangled Swift symbols with swift-demangle. Some symbols are de-mangled just fine, but some others can't be de-mangled at all no matter what version of Swift I'm using. 

Steps to Reproduce:

Run swift-damangle with the following command:

swift-demangle -compact -no-sugar -simplified _TTSf4g_n_n_n___TTOFE5UIKitCSo18NSAttributedStringcfzT4dataV10Foundation4Data7optionsGVs10DictionarySSP__18documentAttributesGSqGVs33AutoreleasingUnsafeMutablePointerGSqCSo12NSDictionary____S0_

Expected Results:

swift-demangle should return demangled symbol.

Actual Results:

swift-demangle returns the same mangled symbol.


Tried on Swift versions: 2.2.1, 3.0.1, 3.0.2, 3.1, 3.1.1, 4.0.2, 4.0.3 and 4.1,


swift-demangle on the Swift version mentioned above, running on macOS High Sierra.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!