The zero-width space is a valid character in Swift identifiers

Originator:neocool2
Number:rdar://20874712 Date Originated:08-May-2015 07:21 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49)
Classification:Serious Bug Reproducible:Always
 
Summary:

The zero-width space (U+200B) is a valid character in Swift identifiers. This is quite nasty, because it will be invisible (hence the name) in many editors and can cause huge confusion in being so.

See https://gist.github.com/neonichu/9dd8e0b7dcabaf3d9b30 for an example program using it.

Steps to Reproduce:

Compile the example.

Expected Results:

Compilation should fail, indicating that an invalid character is used.

Actual Results:

Program compiles and runs just fine.

Regression: -

Notes: -

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com 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!