Applicative partial application of curried functions with named parameters causes type mismatch

Originator:gordon
Number:rdar://20727035 Date Originated:28-Apr-2015 10:53 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 1.2
Classification:Serious Bug Reproducible:Always
 
Summary:
Partially applying a curried function (using concepts from Haskell’s Applicative typeclass) results in a type mismatch when the curried function has named parameters.

Steps to Reproduce:
1. Open the attached playground

Expected Results:
`baz` should be able to apply `f` on line 34

Actual Results:
`f` has a named parameter, causing a type mismatch, and so can’t be applied.

Notes:
1. This happens for our custom types, as well as with `Array`. It _doesn’t_ happen with `Optional`, however.
2. Ignoring the external labels in the curried function causes the error to go away:

```
func curried(_ foo: String)(_ bar: String)(_ baz: String) -> String
```

Comments

Gist of the submitted playground: https://gist.github.com/gfontenot/ffced0f07c2ce1fc2a23


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!