scala/scala — pull request #595 by som-snytt (2012-05-21 20:11:50+00:00)
Title: SI-3761: Overload resolution fails on by-name parameter

Minimized. This version should help in review for correctness. No attempt is made to address holes in the spec or to correct indentation.

We saw Yellow Submarine over the weekend and I must have got carried away by the lyric, "There's nothing you can do that can't be done."

When isAsSpecific checks if method m applies to args of types of
formal params of m1, a by-name parameter was converted to its
underlying result type for the params (of m) but not the args (of m1).
This had the useful effect of making m(A) more specific than m(=>A),
which is the specified prioritization for implicit views,
but also made m(=>A) and m(=>A, B*) ambiguous. To handle this edge
case, the isCompatible test for A and =>A is made explicit, and
by-name params are no longer converted.