diff options
Diffstat (limited to 'tests/disabled/macro/run/macro-bundle-static')
-rw-r--r-- | tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala | 30 | ||||
-rw-r--r-- | tests/disabled/macro/run/macro-bundle-static/Test_2.scala | 8 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala new file mode 100644 index 000000000..0142e5d94 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-static/Impls_Macros_1.scala @@ -0,0 +1,30 @@ +import scala.reflect.macros.blackbox.Context +import scala.language.experimental.macros + +object Enclosing { + 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 Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] +} + +package pkg { + object Enclosing { + 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 Enclosing.Impl.mono + def poly[T] = macro Enclosing.Impl.poly[T] + } +}
\ No newline at end of file diff --git a/tests/disabled/macro/run/macro-bundle-static/Test_2.scala b/tests/disabled/macro/run/macro-bundle-static/Test_2.scala new file mode 100644 index 000000000..cfc1e1563 --- /dev/null +++ b/tests/disabled/macro/run/macro-bundle-static/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends dotty.runtime.LegacyApp { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Enclosing.Impl(???).weird) + println(pkg.Macros.mono) + println(pkg.Macros.poly[Int]) + println(new pkg.Enclosing.Impl(???).weird) +}
\ No newline at end of file |