You can try the following:
def the[T: ClassManifest]: Class[T] = classManifest[T].erasure.asInstanceOf[Class[T]]
The designation [T: ClassManifest] is a context binding and is equivalent to:
def the[T](implicit classManifest: ClassManifest[T])
Implicit values โโfor Manifest[T] and ClassManifest[T] automatically populated by the compiler (if it can confirm the type parameter passed to the method) and provide you with information about the T runtime: ClassManifest just ClassManifest it as Class[_] and Manifest can additionally tell to you about the possible parameterization of T itself (for example, if T is Option[String] , then you can also learn about the String part).
Jean-philippe pellet
source share