summaryrefslogtreecommitdiff
path: root/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
blob: e5bdca008eea430e86af5127bb47554f82e87e4c (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 foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = {
    import c.universe._
    val sum = Apply(Select(x.tree, newTermName("$plus")), List(y.tree))
    val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum))
    c.Expr[Unit](body)
  }
}

object Macros {
  def foo(x: Int)(y: Int) = macro Impls.foo
}