Swift Strings assignments fails without enough spaces between string and identifier
| Originator: | dfreniche | ||
| Number: | rdar://17339634 | Date Originated: | 17/06/2014 |
| Status: | Closed-marked as duplicated | Resolved: | No |
| Product: | Xcode 6 Beta 4 | Product Version: | 6.0 / 6A215l |
| Classification: | Reproducible: | Always |
When you assign a Swift String to a variable, you *have to* put whitespaces around the assignment operator or no spaces at all. This is not always desirable (different coding styles) and confusing for people learning Swift. var s = "This is Ok" s = "ok" s="Still ok" s = "Ok, obviously" s= "compiler error" // Prefix / postfix '=' is reserved s ="compiler error // Prefix / postfix '=' is reserved
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!