Implicit is not considered if method in question has a(n unused) type parameter #5107
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
implicit
infer
Milestone
Consider this code, defining a simple class with a method named
**
:Now we add a new classes and correspondent implicits to "add more supported types" to
Foo
s**
method:While the first and the last work, the second one fails:
The only difference between the second and the third example is the removal of the (unused) type parameter
M
.It looks like as if the implicit method didn't even get considered when it had the type parameter.
This bug report is a result of http://stackoverflow.com/questions/7649517/
I already tried to read the spec to figure out if this is as expected or if this is a bug, but especially in 6.26.3 I haven't understood it fully.
I hope this can be fixed, because this behavior precludes any possibility of working with numbers where one of arguments is a parametrized type.
So while
5 * BigInt(5)
will work, things like5 * Complex[Long](...)
(math),5 * Currency[€](...)
(money), 5 * QuantityMass` will not be possible.The text was updated successfully, but these errors were encountered: