I meet a weird problem of pattern matching in scala. The following code will complain compilation error. But if I remove one case statement, it will compile successfully. So there're two things confused me. One is that it looks like the the maximum pattern matching number of scala is 9. Another thing is the error message, I did not use sbt in this project, I use it in another project. Anyone can help me ?
The SBT builder crashed while compiling your project. This is a bug in the Scala compiler or SBT. Check the Erorr Log for details. The error message is: ch.epfl.lamp.fjbg.JCode$OffsetTooBigException: offset too big to fit in 16 bits: 38092 scala 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() =>
}
}