Is there a limit on the number of matches for scala patterns?

I encounter a strange pattern matching problem in scala. The following code will complain about a compilation error. But if I delete one case statement, it will compile successfully. So, two things confuse me. Firstly, it looks like the maximum number of matches for scala patterns is 9. Another thing is the error message, I did not use sbt in this project, I use it in another project. Can anybody help me?

SBT creator crashed while compiling your project. This is a bug in the scala or SBT compiler. Check the error log Erorr. Error message: ch.epfl.lamp.fjbg.Jcode $ OffsetTooBigException: offset too large to fit 16 bits: scala 38092 Unknown scala Problem

 def main(args: Array[String]) {
    val list = List(1, 2, 3)

    import scala.collection.JavaConversions._
    val pattern_1 = """1""".r
    val pattern_2 = """1""".r
    val pattern_3 = """1""".r
    val pattern_4 = """1""".r
    val pattern_5 = """1""".r
    val pattern_6 = """1""".r
    val pattern_7 = """1""".r
    val pattern_8 = """1""".r
    val pattern_9 = """1""".r
    val pattern_10 = """1""".r

    "ffd,fa".split(",") foreach {
      case pattern_1() =>
      case pattern_2() =>
      case pattern_3() =>
      case pattern_4() =>
      case pattern_5() =>
      case pattern_6() =>
      case pattern_7() =>
      case pattern_8() =>
      case pattern_9() =>
    }
  }
+5
1

. . , 2.10.

, .

+10

All Articles