1

我需要这样的东西:

object Macros {

  def check[T](f: T): Any = macro check_impl[T]

  def check_impl[T](c: Context)(f: c.Expr[Any]): c.Expr[T] = {

    import c.universe._

    //get all methods and if exist Method2 or Method4(need check methods recursively) println("OK")
  }

}

def test(....) = Macros.check {

  val x1 = Method1()

  val x2 = Method2()

  val x3 = Method3()
}



def method3(....) = {

  val x4 = Method4()

}
4

0 回答 0