On Tue, Feb 12, 2013 at 9:13 AM, eric vantillard
<eric.vantil...@gmail.com> wrote:
can somebody explain me where I was wrong with my first solution ?
To me it appears to be a bug, but I'm always wrong about these implicit situations.
The implicit search goes looking for Int => Option[Double] and never finds it. There is an implicit from U => Option[T] which can be called explicitly, but it appears to infer T=Int and U=Nothing. This is one of those things which strikes in a variety of places due to the order in which type parameters are solved.
By way of illustration, it compiles if you add this, which gives you an implicit with the specific types it needs to find.
implicit val bippy = asOptional[Double, Int] _