0
votes

I have an opaque type FancyDouble, which is implicitly converted from Double by using given Conversion[Double] = FancyDouble(_) in the companion object scope. After that, the construction val d: FancyDouble = 0.0 works, but when I try to do the comparison like if (d == 0.0), the compiler is complaining that I can't compare FanceDouble and Double (I am expecting that it should implicitly convert the 0.0 literal into FancyDouble, like in the previous case.

How can I enable the comparison with implicit conversions?