I'm trying to write some code to convert an implicit argument, like the following:
case class A()
case class B()
object B {
implicit def b2a(b: B): A = new A()
}
def foo(f: B => String) = f(new B())
def bar(implicit a: A) = "A"
foo { implicit b =>
bar()
}
gives the error:
<console>:27: error: not enough arguments for method bar: (implicit a: A)String.
Unspecified value parameter a.
Is there a way to use the implicit conversion without calling it manually?