How to instantiate an instance of type represented by type parameter in Scala
EDIT – apologies, I only just noticed your first error. There is no way of instantiating a T at runtime because the type information is lost when your program is compiled (via type erasure) You will have to pass in some factory to achieve the construction: class BalanceActor[T <: Actor](val fac: () => T) extends … Read more