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

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -