The first example successfully finds the implicit conversion to the method foo(String)
, however as soon as I add a type parameter (see fails
) the c
Both cases seem to fall under this case of the specification:
Views are applied in three situations:
...
In a selection
e.m(args)
withe
of typeT
, if the selectorm
denotes some member(s) ofT
, but none of these members is applicable to the argumentsargs
. In this case a viewv
is searched which is applicable toe
and whose result contains a methodm
which is applicable toargs
. The search proceeds as in the case of implicit parameters, where the implicit scope is the one ofT
. If such a view is found, the selectione.m
is converted tov(e).m(args)
.
So it should work. I was actually surprised to see it, because I've never run into the working case before and assumed that there is no implicit search if T
has any members named m
. I've taken a quick look at http://issues.scala-lang.org/, but couldn't find a relevant issue.