scala - How can I implement concrete class which extends trait defining a method with type by the type parameter's type alias -
i ask advanced scala developers. problem access type alias belonging type parameters of class' parent. case class mymodel(foo: string = "bar") case class mydispatcher() trait module[m, d] { type dispatcher = d type model = m } trait myspecificmodule[a <: module[_, _]] { def dispatcher(): a#dispatcher } class moduleclass extends module[mymodel, mydispatcher] { //... } class myspecificmoduleclass extends myspecificmodule[moduleclass] { override def dispatcher(): mydispatcher = mydispatcher() } so myspecificmodule extends generic trait, , should know type of dispatcher method. in case of myspecificmoduleclass should mydispatcher . when try compile code getting compilation error because type of method, not same defined: a#dispatcher , in reality is. error:(21, 18) overriding method dispatcher in trait myspecificmodule of type ()_$2; method dispatcher has incompatible type override def dispatcher(): mydispatcher...