summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala
blob: c83e401afb1f266e415db9affb37fb641b277ead (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import scala.reflect.makro.{Context => Ctx}

object Impls {
  def foo[T, U: c.TypeTag, V](c: Ctx)(implicit T: c.TypeTag[T], V: c.TypeTag[V]): c.Expr[Unit] = {
    import c.mirror._
    Block(List(
      Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))),
      Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.TypeTag[U]].toString)))),
      Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))),
      Literal(Constant(())))
  }
}

class D[T] {
  class C[U] {
    def foo[V] = macro Impls.foo[T, U, V]
  }
}