For more information
implcitly keyword can be explained as follows
implitly [T] means returning an implicit value of type T in context
This means that to get Foo implicitly you need to create an implicit value in the scope
For instance,
implicit class Foo(val i: Int) { def addValue(v: Int): Int = i + v } implicit val foo:Foo = Foo(1) val fooImplicitly = implicitly[Foo]
Also note that Foo itself is only a class,
But by putting an implicit keyword in front of the class definition,
The compiler creates an implicit function of type Int => Foo
source share