scala - how to get ClassTag[Long] from 10L -
using following code:
val clz = 10l.getclass val classtag(clz)
only boxed type:
java.lang.long
is there better solution? or impossible in scala?
what makes think boxed? not:
scala> classtag(10l.getclass).runtimeclass.getname res15: string = long scala> classtag(10l.getclass).runtimeclass == java.lang.long.type res17: boolean = true scala> classtag(10l.getclass).runtimeclass == new java.lang.long(10).getclass res18: boolean = false
Comments
Post a Comment