diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t9392/client_2.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t9392/macro_1.scala | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t9392/client_2.scala b/test/files/pos/t9392/client_2.scala new file mode 100644 index 0000000000..6b706fea12 --- /dev/null +++ b/test/files/pos/t9392/client_2.scala @@ -0,0 +1,4 @@ +class Client { + Macro() +} + 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 +} |