blob: 4d58467638f55a84d2ef22605cf311a5ccbbfcc9 (
plain) (
tree)
|
|
import scala.reflect.runtime.universe._
import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo[T: c.TypeTag, U: c.TypeTag](c: Ctx)(x: c.Expr[U]) = {
import c.universe._
val T = implicitly[c.TypeTag[T]]
val U = implicitly[c.TypeTag[U]]
val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString + " " + U.toString))))
c.Expr[Unit](body)
}
}
|