我想实现proxy
一些特征A
(例如,将方法调用委托给一些 rpc 调用),就像这样
def clientProxy[A](using Type[A], Quotes): Expr[A] = {
import quotes.reflect._
val defTrees: List[Tree] = TypeRepr.of[A].typeSymbol.memberFields.collect {
case mf if mf.isDefDef =>
???
}
val exprs = Expr.ofList(defTrees.map(_.asExpr))
'{
new A {
$exprs
}
}
}
但是编译器抱怨
A is not a class type