blob: e95d61a36a8967004b3402915095a3ec5554ceda (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
import scala.reflect.runtime.universe._
import scala.reflect.macros.{BlackboxContext => Ctx}
object Impls {
def foo[U: c.WeakTypeTag](c: Ctx) = {
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString))))
c.Expr[Unit](body)
}
}
|