Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Foo {
- def double(i: Int): Int = 2 * i
- }
- object Stuff {
- import scala.reflect._
- def gct = classTag[Foo.type]
- def getFromClassTag[T](ct: ClassTag[T]): T =
- ct.runtimeClass.newInstance.asInstanceOf[T]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement