blob: 889240d628210f5bf1dab9940cf336f40e7a47e1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import scala.reflect.macros.{BlackboxContext => Ctx}
object Impls {
def myprintln(xs: Int*) = {
println(xs)
}
def foo(c: Ctx)(xs: c.Expr[Int]*) = {
import c.universe._
val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList)
c.Expr[Unit](body)
}
}
|