Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification incomplete on pattern sequences #5136

Closed
scabug opened this issue Nov 1, 2011 · 3 comments
Closed

Specification incomplete on pattern sequences #5136

scabug opened this issue Nov 1, 2011 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 1, 2011

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])]
@scabug
Copy link
Author

@scabug scabug commented Nov 1, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5136?orig=1
Reporter: @jsalvata
Affected Versions: 2.9.0-1

@scabug
Copy link
Author

@scabug scabug commented Jul 10, 2013

@adriaanm said:
Unassigning and rescheduling to M6 as previous deadline was missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants