diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-23 10:01:24 -0600 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-23 10:01:24 -0600 |
commit | efa99c01974febe227937f090afbb93b9a6a59a5 (patch) | |
tree | a5656dda5c063d10c9d72f614a39ceb8a7828b1c /test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala | |
parent | 6a9767b95216badc5cc8080f430d6a517fbdac4a (diff) | |
parent | dded01b234542501fa62821376a4d853e24250d4 (diff) | |
download | scala-efa99c01974febe227937f090afbb93b9a6a59a5.tar.gz scala-efa99c01974febe227937f090afbb93b9a6a59a5.tar.bz2 scala-efa99c01974febe227937f090afbb93b9a6a59a5.zip |
Merge pull request #3571 from xeno-by/ticket/8321
SI-8321 bundles can't be whitebox
Diffstat (limited to 'test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala')
-rw-r--r-- | test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala b/test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala new file mode 100644 index 0000000000..5e1b11895d --- /dev/null +++ b/test/files/run/macro-bundle-whitebox-decl/Impls_Macros_1.scala @@ -0,0 +1,26 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Unit](q"()") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") } + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +} + +package pkg { + class Impl(val c: Context) { + def mono = { import c.universe._; c.Expr[Boolean](q"true") } + def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") } + def weird = macro mono + } + + object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] + } +}
\ No newline at end of file |