diff options
Diffstat (limited to 'test/files/neg/macro-blackbox-structural')
-rw-r--r-- | test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala | 15 | ||||
-rw-r--r-- | test/files/neg/macro-blackbox-structural/Test_2.scala | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala b/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala new file mode 100644 index 0000000000..08f1c21e89 --- /dev/null +++ b/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.language.experimental.macros + +object Macros { + def impl(c: scala.reflect.macros.BlackboxContext) = { + import c.universe._ + q""" + trait Foo { + def x = 2 + } + new Foo {} + """ + } + + def foo = macro impl +}
\ No newline at end of file diff --git a/test/files/neg/macro-blackbox-structural/Test_2.scala b/test/files/neg/macro-blackbox-structural/Test_2.scala new file mode 100644 index 0000000000..ea6a817e34 --- /dev/null +++ b/test/files/neg/macro-blackbox-structural/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends App { + println(Macros.foo.x) +}
\ No newline at end of file |