This is actually something we’ve spoken about in the core team meetings in the past as a known thing that ideally would work but doesn’t. The one that hits me a often is that I wish .forEach(print) worked, as it’s very useful as a quick debugging command.
I don’t know if we’re tracking it on bugs.swift.org though, so it’d be good to see if you can find an SR for it there and if not, put your very clear explanation of the issue in a new SR.
Thanks,
Ben
···
On Jun 17, 2017, at 5:14 PM, Oskar Ek via swift-evolution <swift-evolution@swift.org> wrote:
Hello Swift evolution community!
Developing in Swift, I have many times found myself being frustrated that a function with default parameters can’t be passed to another function.
This should be easier to implement now that unbound reference to a function foo is lowered to a closure { foo($0, $1, …) } by the type checker, instead of SILGen knowing how to emit this construct directly. The closure would take fewer arguments based on its contextual type, with the constructed call inside the closure passing these default arguments.
That's currently the issue, but what's being proposed is that Swift supports using the function in this context because it can be called with a single argument.