After some digging I confirm what @Alexey Romanov said. Consider following example:
case class A(implicit implicit val a: Int)
def foo(x: Int)(implicit y: Int): Int = x * y
We could use it like this:
implicit val m: Int = 2
val myA = A()
And the following application:
val myAA = A()(2)
val n = myAA.a
foo(3)
Now, foo(3)
obviously yields 6 since it takes n
implicitly. If we change the class to
case class A(implicit val a: Int)
it does not change the behavior of foo
. Therefore, we arrive to the same conclusion that @Alexey - first implicit
indicates that the constructor parameter can be passed implicitly; whereas the second one defines implicit value - even though in this case, they do the same thing.
foo
takesm
implicitly, it's hidden by a fact thatn ==m
.n
isn't declared as implicit so it can't be used that way, moreover if one would declare two values of the same type implicit in the same scope, compiler would raise an error because of ambiguity – Fugger