scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

java.lang.ArrayIndexOutOfBoundsException while compiling xhtml1-strict.scala #3631

Closed scabug closed 13 years ago

scabug commented 14 years ago

Build: Scala version 2.8.0.r22424-b20100630020140 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).

Note: xhtml1-strict.scala was generated from the schema of XHTML using my private build of [http://scalaxb.org/ scalaxb], so it's a little big. There may be some issue with the generated code, but I can't tell from the error message.

Steps:

$$ scalac xhtml1-strict.scala Helper.scala

Problem:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 24
    at scala.tools.nsc.ast.TreeGen.scalaFunctionConstr(TreeGen.scala:34)
    at scala.tools.nsc.typechecker.Unapplies$$class.createFun$$1(Unapplies.scala:137)
    at scala.tools.nsc.typechecker.Unapplies$$class.parents$$1(Unapplies.scala:138)
    at scala.tools.nsc.typechecker.Unapplies$$class.caseModuleDef(Unapplies.scala:140)
    at scala.tools.nsc.Global$$analyzer$$.caseModuleDef(Global.scala:295)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$5.apply(Namers.scala:353)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$5.apply(Namers.scala:353)
    at scala.tools.nsc.typechecker.Namers$$Namer.ensureCompanionObject(Namers.scala:295)
    at scala.tools.nsc.typechecker.Namers$$Namer.enterSym(Namers.scala:353)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$enterSyms$$1.apply(Namers.scala:257)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$enterSyms$$1.apply(Namers.scala:256)
    at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:61)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.tools.nsc.typechecker.Namers$$Namer.enterSyms(Namers.scala:256)
    at scala.tools.nsc.typechecker.Namers$$Namer.enterSym(Namers.scala:347)
    at scala.tools.nsc.typechecker.Analyzer$$namerFactory$$$$anon$$1.apply(Analyzer.scala:39)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:276)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:276)
    at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:48)
    at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:276)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:252)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:252)
    at scala.collection.Iterator$$class.foreach(Iterator.scala:631)
    at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:304)
    at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:252)
    at scala.tools.nsc.Global$$Run.compileSources(Global.scala:733)
    at scala.tools.nsc.Global$$Run.compile(Global.scala:813)
    at scala.tools.nsc.Main$$.process(Main.scala:108)
    at scala.tools.nsc.Main$$.main(Main.scala:122)
    at scala.tools.nsc.Main.main(Main.scala)
scabug commented 14 years ago

Imported From: https://issues.scala-lang.org/browse/SI-3631?orig=1 Reporter: Eugene Yokota (eed3si9n) Attachments:

scabug commented 14 years ago

@paulp said: It should fail more gracefully, but it's still going to fail. Many things have an arity limit of 22 (tuples, products, functions, and anything which derives from them, like case classes.) "java.lang.ArrayIndexOutOfBoundsException: 24" is a pretty good sign you are in the red zone.

scabug commented 14 years ago

Eugene Yokota (eed3si9n) said: Replying to [comment:1 extempore]:

Many things have an arity limit of 22

That makes sense. I was expecting value Tuple23 is not a member of package scala when there are more than 22 params on a case class, but I guess there are more than one way for this limitation to present itself.

scabug commented 14 years ago

@paulp said: (In r22466) Fail more gracefully on > 22 case class parameters. Closes #3631, no review.