Is there a reflective way to access classes methods' AST?
class Clazz {
def hello(a: Int) = (a + 1).toLong
}
val src =
"""
class Clazz {
def hello(a: Int) = (a + 1).toLong
}
"""
I want to get something like this
scala> val a = 100
scala> showRaw(reify((a + 1).toLong).tree)
res2: String = Select(Apply(Select(Select(Select(Select(Select(Select(Ident($line11.$read), newTermName("$iw")), newTermName("$iw")), newTermName("$iw")), newTermName("$iw")), newTermName("a")), newTermName("$plus")), List(Literal(Constant(1)))), newTermName("toLong"))
as a result.
I believe this is going to be a compile-time universe.