I'm confused by this description in "5.1.3 Implicit resolution" in Joshua Suareth's book Scala in depth, on Page 100:
Scala objects can't have companion objects for implicits. Because of this, implicits associated with the object's type, that are desired on the implicit scope of that object's type, must be provided from an outer scope. Here's an example:
scala> object Foo {
| object Bar { override def toString = "Bar" }
| implicit def b : Bar.type = Bar
|}
defined module Foo
scala> implicitly[Foo.Bar.type]
res1: Foo.Bar.type = Bar
But while I make object Bar implicit in REPL:
scala> object Foo {
| implicit object Bar {
| override def toString = "isBar" }
| }
defined module Foo
scala> implicitly[Foo.Bar.type]
res0: Foo.Bar.type = isBar
It seems that it doesn't need to define an implicit in the outer scope. Or do I take Joshua's meaning completely wrong?