Skip to content

Instantly share code, notes, and snippets.

@zen0wu
Created June 29, 2014 06:48
Show Gist options
  • Select an option

  • Save zen0wu/dc7922efa9df10f1ef6b to your computer and use it in GitHub Desktop.

Select an option

Save zen0wu/dc7922efa9df10f1ef6b to your computer and use it in GitHub Desktop.

Revisions

  1. zen0wu created this gist Jun 29, 2014.
    23 changes: 23 additions & 0 deletions reifyTree-result.scala
    Original 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()
    }))
    }