Skip to content

Instantly share code, notes, and snippets.

@retronym
Created February 2, 2015 02:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save retronym/0440cd94f6b531d0e5a0 to your computer and use it in GitHub Desktop.
Save retronym/0440cd94f6b531d0e5a0 to your computer and use it in GitHub Desktop.
Can't shortcut =:= in runtime reflection
scala-hash v2.11.5 -nobootcp
Welcome to Scala version 2.11.5-20150101-184742-3fafbc204f (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import reflect.runtime.universe._
import reflect.runtime.universe._
scala> showRaw(typeOf[Predef.String], printIds = true)
res0: String = TypeRef(SingleType(ThisType(scala#8700), scala.Predef#2197), TypeName("String")#3318, List())
scala> showRaw(typeOf[Predef.String].dealias, printIds = true)
res1: String = TypeRef(ThisType(java.lang#9), java.lang.String#707, List())
scala> showRaw(typeOf[java.lang.String], printIds = true)
res2: String = TypeRef(ThisType(java.lang#143), java.lang.String#707, List())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment