Scala Programming Language
  1. Scala Programming Language
  2. SI-6942

Pattern Matcher causes Stack Overflow on large Java Enums

    Details

      Description

      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

      1. Bar.java
        10 kB
        Chris Marshall

        Issue Links

          Activity

          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/1915
          Hide
          Jason Zaugg added a comment -

          I've closed SI-6790 as a duplicate.

          Show
          Jason Zaugg added a comment - I've closed SI-6790 as a duplicate.

            People

            • Assignee:
              Adriaan Moors
              Reporter:
              Chris Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development