This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: issue with implicit conversion

1 reply
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

>>>>> "Raphael" == Raphael Jolly writes:

Raphael> x+x*y

Raphael> error: type mismatch; [java] found : Poly[Poly[A]] [java]
Raphael> required: Poly[A] [java] x+x*y [java] ^

Raphael> I would like to know if this is by design, or if not, if there
Raphael> is a chance that it might be corrected in the future.

I looked at this for a while and I cannot understand why this doesn't
compile. Either it's a compiler bug, or there's something I don't
understand about the rules for implicits (and hopefully someone can
educate both of us).

Matt Hellige
Joined: 2009-01-28,
User offline. Last seen 42 years 45 weeks ago.
Re: issue with implicit conversion

On Fri, Feb 27, 2009 at 9:44 AM, Seth Tisue wrote:
>>>>>> "Raphael" == Raphael Jolly writes:
>
>  Raphael> x+x*y
>
>  Raphael> error: type mismatch; [java] found : Poly[Poly[A]] [java]
>  Raphael> required: Poly[A] [java] x+x*y [java] ^
>
>  Raphael> I would like to know if this is by design, or if not, if there
>  Raphael> is a chance that it might be corrected in the future.
>
> I looked at this for a while and I cannot understand why this doesn't
> compile.  Either it's a compiler bug, or there's something I don't
> understand about the rules for implicits (and hopefully someone can
> educate both of us).
>

Yeah, this seems really weird. It seems like type inference is
proceeding top-down and committing too early, but I have no idea if
this is "as specified" or a bug... I hope it's a bug.

Matt

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland