summaryrefslogtreecommitdiff
path: root/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
blob: a54b7f4b082f46eb707499d6593e00d8e10e9446 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import scala.reflect.macros.{Context => Ctx}

object Impls {
  def foo[T: c.AbsTypeTag](c: Ctx)(x: c.Expr[T]) = {
    import c.universe._
    val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(x.tree.toString))))
    c.Expr[Unit](body)
  }
}

object Macros {
  def foo[T](x: T) = macro Impls.foo[T]
}