1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class X(elem: Int) extends Object object Implicits { implicit val impl: X = new X(0) implicit def conv(x: Int): X = new X(x) val a: Object = "abc" val b: Any = "abc" def foo(x: Int)(implicit y: X): Int = { println(y) x } val y: Int = foo(1) val z: X = 3 }