diff options
Diffstat (limited to 'test/files/pos/t9392/macro_1.scala')
-rw-r--r-- | test/files/pos/t9392/macro_1.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t9392/macro_1.scala b/test/files/pos/t9392/macro_1.scala new file mode 100644 index 0000000000..3f67ac17b2 --- /dev/null +++ b/test/files/pos/t9392/macro_1.scala @@ -0,0 +1,16 @@ +import language.experimental.macros + + +object Macro { + + import reflect.macros.blackbox.Context + def impl(c: Context)(): c.Tree = { + import c.universe._ + val tree = q"""class C; new C""" + val tree1 = c.typecheck(tree) + val tpe = tree1.tpe + val tree2 = c.typecheck(c.untypecheck(tree1)) + q"""$tree2.asInstanceOf[$tpe]""" + } + def apply(): Any = macro impl +} |