blob: 081894cf529ff282b45f69d4850d6caf68435b31 (
plain) (
blame)
1
2
3
4
5
6
7
8
|
import scala.reflect.runtime.universe._
import scala.reflect.macros.Context
object Macros {
def impl[T: c.AbsTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = c.universe.reify { println(c.literal(implicitly[c.AbsTypeTag[T]].toString).splice) }
def foo[T](foo: T) = macro impl[T]
}
|