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 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
Copy link
Author

scabug commented Nov 23, 2010

Imported From: https://issues.scala-lang.org/browse/SI-4025?orig=1
Reporter: @paulp

@scabug
Copy link
Author

scabug commented Nov 23, 2010

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

@scabug
Copy link
Author

scabug commented Nov 23, 2010

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

@scabug
Copy link
Author

scabug commented May 12, 2012

@retronym said:
Closing pending the merge of:

scala/scala#540

Not sure when it was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants