blob: 68ead9b9a50208619d9db75942b0c63e7e842426 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[String]): c.Expr[Option[Int]] = {
import c.universe._
val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, newTermName("toInt"))))
c.Expr[Option[Int]](body)
}
}
|