summaryrefslogblamecommitdiff
path: root/test/files/run/macro-expand-nullary-generic/Impls_1.scala
blob: 10352594f56a24a6d95b4e3b9958bc1fa5e2b2ad (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                                                                                                      
import scala.reflect.makro.{Context => Ctx}

object Impls {
  def impl[T: c.TypeTag](c: Ctx) = {
    import c.mirror._
    val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works " + implicitly[c.TypeTag[T]]))))
    Expr[Unit](body)
  }

  def fooNullary[T: c.TypeTag](c: Ctx) = impl[T](c)
  def fooEmpty[T: c.TypeTag](c: Ctx)() = impl[T](c)
  def barNullary[T: c.TypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c)
  def barEmpty[T: c.TypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c)
}