Re: [swift-dev] Function overload resolution

2017-09-27 Thread Nevin Brackett-Rozinsky via swift-dev
On Wed, Sep 27, 2017 at 12:23 PM, Jordan Rose wrote: > > > This is *definitely* a change that would need to go through > swift-evolution. There are a number of potential issues and possibilities > for breaking existing code that’s relying on this shadowing behavior, > intentionally or unintentiona

Re: [swift-dev] Function overload resolution

2017-09-27 Thread Jordan Rose via swift-dev
> On Sep 26, 2017, at 18:02, Robert Widmann via swift-dev > wrote: > >> >> On Sep 25, 2017, at 10:01 AM, Nevin Brackett-Rozinsky >> mailto:nevin.brackettrozin...@gmail.com>> >> wrote: >> >> func triple(_ x: Int) -> Int { >> return 3 * x >> } >> >> extension Int { >> func triple() -

Re: [swift-dev] Function overload resolution

2017-09-26 Thread Robert Widmann via swift-dev
> On Sep 25, 2017, at 10:01 AM, Nevin Brackett-Rozinsky > wrote: > > func triple(_ x: Int) -> Int { > return 3 * x > } > > extension Int { > func triple() -> Int { > return triple(self) // Error here > } > } > > > The error reads: > > Playground execution failed: > e

Re: [swift-dev] Function overload resolution

2017-09-25 Thread Nevin Brackett-Rozinsky via swift-dev
func triple(_ x: Int) -> Int { return 3 * x } extension Int { func triple() -> Int { return triple(self) // Error here } } The error reads: Playground execution failed: > error: Test.playground:5:16: error: use of 'triple' refers to instance > method 'triple()' rather th

Re: [swift-dev] Function overload resolution

2017-09-24 Thread Robert Widmann via swift-dev
If either function had the correct signature and was being properly disambiguated there would not be a diagnostic popped. Can you provide an example of this? ~Robert Widmann > On Sep 24, 2017, at 8:58 PM, Nevin Brackett-Rozinsky > wrote: > > The new diagnostic is fine, the problem is that t

Re: [swift-dev] Function overload resolution

2017-09-24 Thread Nevin Brackett-Rozinsky via swift-dev
The new diagnostic is fine, the problem is that there should not be an error at all. If there is only one function with the proper signature, the compiler should not invent a non-existent ambiguity. The situation I encountered involves functions of different arities, so it should be straightforwar

Re: [swift-dev] Function overload resolution

2017-09-24 Thread Robert Widmann via swift-dev
This appears to be resolved (in fact, I remember improving this some time ago). I get a much better diagnostic now > error: repl.swift:4:16: error: use of 'min' refers to instance method 'min()' > rather than global function 'min' in module 'Swift' > return min(1,2) >^ >

[swift-dev] Function overload resolution

2017-09-24 Thread Nevin Brackett-Rozinsky via swift-dev
I recently got bit by SR-2450 , and I’d like to try to fix it. However, I’ve never worked on the compiler before and I have some questions: 1. Is this a reasonable first bug to tackle? 2. What resources are available for newcomers to the Swift project? 3. Wha