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

repl-specific pattern matcher crasher #4025

Closed
scabug opened this issue Nov 23, 2010 · 4 comments
Closed

repl-specific pattern matcher crasher #4025

scabug opened this issue Nov 23, 2010 · 4 comments
Assignees
Labels

Comments

@scabug
Copy link

@scabug scabug commented Nov 23, 2010

Looks like it only crashes in the repl for some reason. There has to be a superclass with a val.

scala> class Color(val red: Int)
defined class Color

scala> case class Red(r:Int) extends Color(r)
defined class Red

scala> def f(c: Any) = c match { case Red(_) => () }
Exception in thread "main" java.lang.IndexOutOfBoundsException
	at scala.collection.LinearSeqOptimized$$class.apply(LinearSeqOptimized.scala:53)
	at scala.collection.immutable.List.apply(List.scala:45)
	at scala.tools.nsc.matching.Matrix$$MatrixContext$$PatternVarGroup.apply(Matrix.scala:184)
	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix.classifyPat$$1(ParallelMatching.scala:74)
	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix$$$$anonfun$$1$$$$anonfun$$apply$$1.apply(ParallelMatching.scala:76)
	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix$$$$anonfun$$1$$$$anonfun$$apply$$1.apply(ParallelMatching.scala:76)
	at scala.Function2$$$$anonfun$$tupled$$1.apply(Function2.scala:50)
  ...
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 23, 2010

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 23, 2010

@adriaanm said:
repl and pattern matcher? �that's probably for mr. extempore, n�

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 23, 2010

@paulp said:
Blast it, why don't I think of these things BEFORE opening the ticket.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 12, 2012

@retronym said:
Closing pending the merge of:

scala/scala#540

Not sure when it was fixed.

@scabug scabug closed this May 12, 2012
@scabug scabug added the patmat label Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.