考虑下面的代码:
case class JetDim(dimension: Int) {
require(dimension > 0)
}
object JetDim {
def build(dimension: Int): Int = macro JetDimMacro.apply
}
和宏调用:
def apply(dimension: Int): Int = macro applyImpl
def applyImpl(c: Context)(dimension: c.Expr[Int]): c.Expr[Int] = ...
我得到这个编译时错误:
[error] too few argument lists for macro invocation
[error] def build(dimension: Int): Int = macro JetDimMacro.apply
为什么?