In REPL, there is a command to print type:
scala> val s = "House" scala> import scala.reflect.runtime.universe._ scala> val li = typeOf[List[Int]] scala> :type s String scala> :type li reflect.runtime.universe.Type
How can I get this :: expr function in my Scala type printing program?
Let me explain the functionality of “: type expr”, which I would like to have, something like this:
println(s.colonType)
How can I get such a " colonType " method in my Scala program outside of REPL (where I don't have a command :type )?
source share