blob: d72db872e891d655dd401e79e5f79b1c5bf9163e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(c: Context)(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)
}
}
|