Swift 2: 1.2 → 2 converter replaces tacit uses of toString with String, which does not compile
| Originator: | rix.rob | ||
| Number: | rdar://21326489 | Date Originated: | 10-Jun-2015 04:14 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-7-beta (7A120f) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
Even the Swift converter is confused by constructors not being functions!
Steps to Reproduce:
Get the Swift 2 converter to convert this:
func f() {
[1, 2, 3].map(toString)
}
Expected Results:
I expected it to produce:
func f() {
[1, 2, 3].map { String($0) }
}
or equivalent.
Actual Results:
It actually produced:
func f() {
[1, 2, 3].map(String)
}
Regression:
N/A
Notes:
I think it has the right idea, you should just make constructors first class instead.
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!