Uploaded image for project: '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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: