[Swift] Parse issues with assignment operators
All or most of the various assignment operators (=, +=, -=, *=, /=) currently have very strict rules about their surrounding whitespace. The operators must either have no whitespace separating them from either operand, or whitespace between them and both operands. Having whitespace only between the operator and one operand, but not the other, results in a compiler error.
Steps to Reproduce
1. Create a new Playground in Xcode 6.
2. Enter the following:
i = 2
i += 2
i -= 2
i *= 2
i /= 2
(or load the attached playground)
This code should be valid and compile without error.
Several lines produce various compiler errors:
- For the = operator, when there is whitespace on one side of the operator but not the other, the compiler complains "Prefix/Postfix '=' is reserved."
- In the same situation for the other operators, the compiler complains "Consecutive statements on a line must be separated by ';'"
Xcode 6 Beta 1
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!