CwlDemangle icon indicating copy to clipboard operation
CwlDemangle copied to clipboard

Raw identifier support (from Swift 6.2)

Open stevapple opened this issue 8 months ago • 0 comments

Raw identifier support will land in the upcoming Swift 6.2 release, which allows the use of a bunch of characters in an identifier which was not possible before.

I appreciate the work of maintaining this wonderful library. However, I noticed that it may fail to produce correct identifier in some cases with this feature used, eg.:

  • $s6output0018tasksend_jxJBbEnja4taskySS_tF (produced by https://godbolt.org/z/Gx4d37nGo) should be correctly demangled as output.`task/send`(task: Swift.String) -> (), but CwlDemangle outputs output..task.send.(task: Swift.String) -> ();
  • $s6output0020sendtask_miaJCEDGcja4taskySS_tF (produced by https://godbolt.org/z/W3hv5db5z) should be correctly demangled as output.`send task`(task: Swift.String) -> (), but CwlDemangle outputs output..send task.(task: Swift.String) -> ().

It does correctly demangle identifiers like `100` (though the formatting is wrong: raw identifiers should always have surrounding backticks), so I suspect most failures should be related to punycoding.

For the design and implementation detail of the feature, see:

  • https://github.com/swiftlang/swift-evolution/blob/main/proposals/0451-escaped-identifiers.md
  • https://github.com/swiftlang/swift/pull/76636

stevapple avatar May 03 '25 20:05 stevapple