Allow the Use of $ in Operator Identifiers in Swift

Originator:DevTeam.CodaFi
Number:rdar://19528489 Date Originated:19 Jan 2015
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.2 beta 4
Classification:Enhancement Reproducible:Not Applicable
 
Summary: $ is used in prefix form in swift for retrieving arguments by position in closures.  This still leaves infix and postfix form open for user defined operators, or even operators that just use $ somewhere in the name (notably <$>).  Swift should not reserve $ so greedily just because it is used in one particular feature of its syntax.  Strangely, $ is already allowed as an identifier in every other language construct, but not for operators.

Steps to Reproduce: 1.  Attempt to define any operator whose identifier contains the character $

Expected Results: Swift allows such an identifier to be defined without error.

Actual Results: Swift considers all identifiers containing $ to be invalid.

Version: Xcode 6.2 beta 4

Notes: 

Configuration:


Attachments:

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!