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

Pattern Matcher causes Stack Overflow on large Java Enums #6942

Closed
scabug opened this issue Jan 8, 2013 · 3 comments
Closed

Pattern Matcher causes Stack Overflow on large Java Enums #6942

scabug opened this issue Jan 8, 2013 · 3 comments

Comments

@scabug
Copy link

scabug commented Jan 8, 2013

Please find attached a large Java Enum Bar.java, to be placed in a package "foo" and compiled. It is really an enumeration of countries with > 200 entries. If you then write the very simple scala program:

object BugTest extends App {
  import Bar._
  val bar: Bar = null
  def offset: Int = bar match {
    case BULGARIA  => 2
    case _         => 3
  }

}

and try and compile it, it falls over with a Stack Overflow in the pattern matcher. The workaround is to give the compiler a large stack size, for example -Xss4m

@scabug
Copy link
Author

scabug commented Jan 8, 2013

Imported From: https://issues.scala-lang.org/browse/SI-6942?orig=1
Reporter: @oxbowlakes
Affected Versions: 2.10.0
Attachments:

  • Bar.java (created on Jan 8, 2013 3:17:31 PM UTC, 10304 bytes)

@scabug
Copy link
Author

scabug commented Jan 17, 2013

@retronym said:
scala/scala#1915

@scabug
Copy link
Author

scabug commented Jan 19, 2013

@retronym said:
I've closed #6790 as a duplicate.

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

No branches or pull requests

2 participants