[swift-dev] Function overload resolution

Robert Widmann devteam.codafi at gmail.com
Sun Sep 24 21:16:04 CDT 2017


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 <nevin.brackettrozinsky at gmail.com> wrote:
> 
> 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 straightforward to select the correct one, yet it still fails to compile. I'd like to make it work.
> 
> Nevin
> 
> 
> On Sunday, September 24, 2017, Robert Widmann <devteam.codafi at gmail.com <mailto:devteam.codafi at gmail.com>> wrote:
> 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)
> >                ^
> >
> > repl.swift:4:16: note: use 'Swift.' to reference the global function in module 'Swift'
> >         return min(1,2)
> >                ^
> >                Swift.
> 
> What version of Swift are you still seeing the bad diagnostic in?
> 
> ~Robert Widmann
> 
> > On Sep 24, 2017, at 12:03 PM, Nevin Brackett-Rozinsky via swift-dev <swift-dev at swift.org <javascript:;>> wrote:
> >
> > 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. What will I need to learn about in order to address SR-2450?
> >
> > Thanks,
> >
> > Nevin
> > _______________________________________________
> > swift-dev mailing list
> > swift-dev at swift.org <javascript:;>
> > https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170924/c1519146/attachment.html>


More information about the swift-dev mailing list