Given scala version 2.11.7 and this macro definition:
import scala.language.experimental.macros
import scala.reflect.macros.whitebox.Context
package object macrotest {
def namedMacro(c: Context)(a: c.Expr[Int]): c.Expr[Int] = {
println("the int expr was " + a)
a
}
def named(a: Int = 1) = macro namedMacro
}
And this invocation:
object NamedMacroTest {
def main(args: Array[String]) {
named()
//named(a = 5) // or this
}
}
Why do I see this error?
Error:(5, 10) macro applications do not support named and/or default arguments
And what can I do to not get the error, while still being able to call the macro with named and default arguments?