You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scala Language Specification v. 2.9 (24 may 2011), Section 8.1.9 "Pattern Sequences" reads:
"A pattern sequence p 1 , . . . , p n appears in two contexts. First, in a constructor pattern c(q 1 , . . . , q m , p 1 , . . . , p n ), where c is a case class which has m + 1 primary constructor parameters, ending in a repeated parameter (§4.6.2) of type S∗. Second,
in an extractor pattern x(p 1 , . . . , p n ) if the extractor object x has an unapplySeq
method with a result type conforming to Seq[S], but does not have an unapply
method that matches p 1 , . . . , p n ."
The second case seems to be incorrect and incomplete:
All unapplySeq examples I've found actually have return types conforming to Option[Seq[S]], not Seq[S]
Some examples (e.g. scala.xml.Elem) have return types confirming to Option[(,...,Seq[S])]
The text was updated successfully, but these errors were encountered:
Scala Language Specification v. 2.9 (24 may 2011), Section 8.1.9 "Pattern Sequences" reads:
"A pattern sequence p 1 , . . . , p n appears in two contexts. First, in a constructor pattern c(q 1 , . . . , q m , p 1 , . . . , p n ), where c is a case class which has m + 1 primary constructor parameters, ending in a repeated parameter (§4.6.2) of type S∗. Second,
in an extractor pattern x(p 1 , . . . , p n ) if the extractor object x has an unapplySeq
method with a result type conforming to Seq[S], but does not have an unapply
method that matches p 1 , . . . , p n ."
The second case seems to be incorrect and incomplete:
The text was updated successfully, but these errors were encountered: