blob: f748ab855f3e75a0beb216c9a819a06c349a6caa (
plain) (
tree)
|
|
import scala.reflect.runtime.universe._
import scala.reflect.macros.{Context => 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)
}
}
|