summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
blob: 7dc58abba880da43e5075603bc07f73bfe951af0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import scala.reflect.makro.{Context => Ctx}

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

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