blob: aa1fc7a358da4d5be2fbd8be95a1a43236c4a8ad (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
import scala.reflect.macros.{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, TermName("toInt"))))
c.Expr[Option[Int]](body)
}
}
|