[Discussion] Determining argument count from context


(Anton Zhilin) #1

[1,2,3].reduce(0) { $1 } //=> 3
[1,2,3].reduce(0) { $0 } // error :frowning:

Am I requesting too much from type checker?
Will recent function type proposals resolve the issue?


(Paul Cantrell) #2

This is filed here:

聽聽聽聽https://bugs.swift.org/browse/SR-586

There was some discussion about it on the list about whether this is a bug or a dubious feature. Douglas Gregor recently weighed in on that:

I consider this a bug. The removal of implicit tuple splats should, IMO, encompass making $0 consistently capture the first argument. I鈥檇 love for this to happen in Swift 3.

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160627/022448.html

Cheers, P

路路路

On Jul 3, 2016, at 4:04 PM, Anton Zhilin via swift-evolution <swift-evolution@swift.org> wrote:

[1,2,3].reduce(0) { $1 } //=> 3
[1,2,3].reduce(0) { $0 } // error :frowning:

Am I requesting too much from type checker?
Will recent function type proposals resolve the issue?

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Vladimir) #3

[1,2,3].reduce(0) { $1 } //=> 3
[1,2,3].reduce(0) { $0 } // error :frowning:

Am I requesting too much from type checker?
Will recent function type proposals resolve the issue?

Yes, I believe this should be fixed with SE-0110, if accepted

路路路

On 04.07.2016 0:04, Anton Zhilin via swift-evolution wrote:

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution