summaryrefslogtreecommitdiff
path: root/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/annotated-treecopy/Impls_Macros_1.scala')
-rw-r--r--test/files/pos/annotated-treecopy/Impls_Macros_1.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
index fdf9c72c31..79edbfffd8 100644
--- a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
+++ b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
@@ -15,6 +15,7 @@ object Macros {
def tree_impl[T:c.WeakTypeTag,U:c.WeakTypeTag](c: Context)
(f:c.Expr[Function1[T,U]]): c.Expr[Function1[T,U]] = {
import c.universe._
+ import internal._
val ttag = c.weakTypeTag[U]
f match {
case Expr(Function(List(ValDef(_,n,tp,_)),b)) =>
@@ -22,7 +23,7 @@ object Macros {
var b1 = new Transformer {
override def transform(tree: Tree): Tree = tree match {
case Ident(x) if (x==n) => Ident(TermName("_arg"))
- case tt: TypeTree if tt.original != null => TypeTree(tt.tpe) setOriginal transform(tt.original)
+ case tt: TypeTree if tt.original != null => setOriginal(TypeTree(tt.tpe), transform(tt.original))
// without the fix to LazyTreeCopier.Annotated, we would need to uncomment the line below to make the macro work
// that's because the pattern match in the input expression gets expanded into Typed(<x>, TypeTree(<Int @unchecked>))
// with the original of the TypeTree being Annotated(<@unchecked>, Ident(<x>))
@@ -34,7 +35,7 @@ object Macros {
}
}.transform(b)
- val reifiedTree = c.reifyTree(treeBuild.mkRuntimeUniverseRef, EmptyTree, b1)
+ val reifiedTree = c.reifyTree(gen.mkRuntimeUniverseRef, EmptyTree, b1)
val reifiedExpr = c.Expr[scala.reflect.runtime.universe.Expr[T => U]](reifiedTree)
val template =
c.universe.reify(new (T => U) with TypedFunction {