Created
June 29, 2014 06:48
-
-
Save zen0wu/dc7922efa9df10f1ef6b to your computer and use it in GitHub Desktop.
Revisions
-
zen0wu created this gist
Jun 29, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ { val $u: `package`.this.universe.type = `package`.this.universe; val $m: $u.Mirror = `package`.this.universe.runtimeMirror(this.getClass.getClassLoader); $u.Expr.apply($m, { final class $treecreator1 extends TreeCreator { def apply[U >: Nothing <: Universe with Singleton]($m$untyped: Mirror[U]): (U)#Tree = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $u.Literal($u.Constant(3)) } }; new $treecreator1() })($u.TypeTag.apply($m, { final class $typecreator2 extends TypeCreator { def apply[U >: Nothing <: Universe with Singleton]($m$untyped: Mirror[U]): (U)#Type = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; $u.internal.reificationSupport.ConstantType($u.Constant(3)) } }; new $typecreator2() })) }