I am trying to implement a Scala trait that handles the details of interacting with a Java library that requires us to create
I want to do something like:
trait SomeTrait[A] extends JavaAPI {
def foo = {
callApi(classOf[A])
}
override def bar = {
foo
}
}
Note that the bar actually overrides the method from the base class, so I cannot change its signature.
I tried several options with Manifests, etc., but can't make it work. Is there a way to get the runtime class of a parameterized type?
source
share