Skip to content

Instantly share code, notes, and snippets.

@zen0wu
Created June 29, 2014 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zen0wu/dc7922efa9df10f1ef6b to your computer and use it in GitHub Desktop.
Save zen0wu/dc7922efa9df10f1ef6b to your computer and use it in GitHub Desktop.
{
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()
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment