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

subtle source incompatibilty with new overload of Regex#unapplySeq #8022

Closed
scabug opened this issue Dec 1, 2013 · 3 comments
Closed

subtle source incompatibilty with new overload of Regex#unapplySeq #8022

scabug opened this issue Dec 1, 2013 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 1, 2013

val full = """.*: (.)$""".r
val text = "   When I use this operator: *"
val x :: Nil = full.unapplySeq(text: Any).get
val y :: Nil = full.unapplySeq(text: CharSequence).get

In 2.11, the latter returns Option[Seq[String]], with the runtime type being a Vector.

In 2.10, it used to return Option[List[String]].

This change was noticed in specs-gwt.

@scabug
Copy link
Author

@scabug scabug commented Dec 1, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8022?orig=1
Reporter: @retronym
Affected Versions: 2.11.0-M7

@scabug
Copy link
Author

@scabug scabug commented Dec 1, 2013

@retronym said:
And:

scala> val R = """(a)""".r
R: scala.util.matching.Regex = (a)

scala> val Some(List(x)) = R.unapplySeq(R.findFirstMatchIn("a").get)
scala.MatchError: Some(Vector(a)) (of class scala.Some)
  ... 32 elided

@scabug
Copy link
Author

@scabug scabug commented Dec 1, 2013

@scabug scabug closed this Dec 2, 2013
@scabug scabug added this to the 2.11.0-M8 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants