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