I am extending an abstract class which defines an implicit parameter in its constructor.
It seems like there are 3 different ways to do this:
abstract class Base(z: ZType)(implicit a: AType)
// Explicit
class First(z: ZType, a: Atype) extends Base(z)(a)
// Explicitly pass a into the child class which
// implicitly passes it into the parent class
class Second(z: ZType, implicit val a: AType) extends Base(z)
// Implicitly passed into both
class Third(z: ZType)(implicit a: AType) extends Base(z)
Perhaps it depends on how the child class is going to be used. In my case, the child class will not have an implicit AType in scope, so I was leaning toward the second option.
My biggest concern with the second option is that I now have 2 implicits defined for the same type, one in the parent class and one in the child class. Does that have any effect since they will always be the same object? Is the second pattern one I should avoid for any reason?
Basically, is there a "right" pattern here or are all of these acceptable depending on the context of the code they are used in?