我已经解构了Function,得到了vparams,现在我可以调用:
case class Action(f: Function, ts: List[TypeName]) {
def render(ruleName: String): Expr[Unit] = c.Expr[Unit](q"""
val p = ${c.prefix}
val value1 = p.valueStack.pop().asInstanceOf[${ts(0)}]
val value2 = p.valueStack.pop().asInstanceOf[${ts(1)}]
p.valueStack.push($f(value1, value2))
""")
}
f是在编译时已知的任意数量的参数。
如何将ts.count参数从p.valueStack传递给函数f?