Trying to understand this case of implicit finding - finding implicit of an argument's type. I copy-pasted the official example into the IDE and just changed the method name to mul like this:
class A(val n: Int) {
def mul(other: A) = new A(n + other.n)
}
object A {
implicit def fromInt(n: Int) = new A(n)
}
1 mul (new A(1))
Now it results in a compile-error saying:
value mul is not a member of Int
I also tried to experiment with String instead of Int which again resulted in compile error.
Can you explain what part I am doing wrong ?