Swift: Curried functions ignore internal/external name elision
| Originator: | rix.rob | ||
| Number: | rdar://17895772 | Date Originated: | 02-Aug-2014 06:52 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode6-Beta4 (6A267n) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
The function returned from a curried function/method ignores the _ to omit external parameter names, and must always be called with all parameter names supplied.
Steps to Reproduce:
1. Attempt to compile this code:
class C {
func f(x: Int)(y: Int, _ z: Int) -> Int {
return 0
}
}
let g = C().f(1)
let h = g(1, 1)
Expected Results:
I expected it to compile.
Actual Results:
It errors:
error: missing argument labels 'y:z:' in call
Regression:
N/A
Notes:
Giving the external name for y as _ causes a warning (extraneous ‘_’) but doesn’t otherwise change the behaviour, i.e. it still errors.
There doesn’t appear to be any way to omit the labels.
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!