diff options
Diffstat (limited to 'tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala')
-rw-r--r-- | tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala b/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala new file mode 100644 index 000000000..9362d6c17 --- /dev/null +++ b/tests/disabled/macro/run/macro-expand-nullary-generic/Impls_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.blackbox.Context + +object Impls { + def impl[T: c.WeakTypeTag](c: Context)(meth: String) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]")))) + c.Expr[Unit](body) + } + + def fooNullary[T: c.WeakTypeTag](c: Context) = impl[T](c)("fooNullary") + def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty") + def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary") + def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty") +}
\ No newline at end of file |