Scala passing type parameters to object

后端 未结 4 1855
北恋
北恋 2021-02-20 09:11

In Scala v 2.7.7

I have a file with

class Something[T] extends Other

object Something extends OtherConstructor[Something]

This throws

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-20 09:36

    Thanks for the answers

    object Something extends OtherConstructor[Something[_]]
    

    seems to be compiling (although I have yet to run/test that :-))

    @oxbow_lakes, I've followed your advice - of avoiding the type system - till now but I've got to do it!!! I've been studying existential types, type-erasure and all that but its still not in my grasp :-(

提交回复
热议问题