According to Scala specifications Section 4.6.3 :
It is not possible to determine any default arguments in a parameter section with a repeating parameter.
In fact, if I define the following case class:
case class Example(value: Option[String] = None, otherValues: String*)
The result that I get is expected as per specification:
error: a parameter section with a `*'-parameter is not allowed to have default arguments case class Example(value: Option[String] = None, otherValues: String*)
But the question is, why is this not allowed? The first argument of the class is completely independent of the repeating argument, so why does this restriction occur?
source share