Why does the following code works:
class X
class A(implicit c: X)
class B(arg: Int)(implicit c: X) extends A
class C(arg: Int)(implicit c: X) extends B(arg)
But not this one:
class X
class A(implicit c: X)
class B[T](arg: T)(implicit c: X) extends A
class C(arg: Int)(implicit c: X) extends B(arg)
Which fails with the following error:
error: could not find implicit value for parameter c: core.X
class C(arg: Int)(implicit c: X) extends B(arg)
It seems to work if you help the type inferencer when calling the constructor for
B:So it doesn’t look like a fundamental limitation. But the error message which you didn’t include is very unhelpful could not find implicit value for parameter c: X.