[swift-dev] Function overload resolution

Nevin Brackett-Rozinsky nevin.brackettrozinsky at gmail.com
Sun Sep 24 19:58:07 CDT 2017


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>
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170924/f886e805/attachment.html>


More information about the swift-dev mailing list