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

object Impls {
  def impl(c: Ctx) = {
    import c.universe._
    val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))
    c.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)
}