Traits cannot have constructor arguments. So how is it possible to write a trait which extends and abstract class which has a non-empty constructor?
abstract class HasConsArgs(val i: Int)
trait Test extends HasConsArgs
Which compiles. But when trying to use;
new Test {}
You get a error not enough arguments for constructor HasConsArgs: ...
... Why is this the case, is it possible to have an implementer of a trait call this constructor somehow?
class Impl(i: Int) extends Test //doesnt work
Fails with error: not enough arguments for constructor HasConsArgs: (i: Int)HasConsArgs.
which means that I probably need to have Impl
extend the HasConsArgs
abstract class...