Aladdin - Scala Bugtracking
[#334] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2004-05-19 21:10:17.0
subject ArrayIndexOutOfBoundsException in typechecker
code
class Test extends scala.xml.Elem;
what happened
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
        at scala.tools.scalac.typechecker.
            Infer$class.formalTypes(Infer.scala:546)
        at scala.tools.scalac.typechecker.
            Analyzer$class.transformArgs(Analyzer.scala:1940)
[..]
what expected Nicely compiles
[back to overview]
Changes of this bug report
Burak  edited on  2004-05-23 14:49:52.0
This bug occurs when type-checking calls with sequence parameters. Reassign to Martin
object testCas {
  
  case class Bla(i:int, d:char*) ;

  class Bar extends Bla {
  }
}
Michel  edited on  2004-06-15 08:37:46.0
Notice that both examples should not compile, because none of them passes enough arguments to the super-class (Elem in the first example, Bla in the second). Generally, the problem seems to appear every time a function/constructor with varying number of arguments is called with mandatory arguments missing. Here is an example which doesn't involve a class:
object O {
  def f(x: Int, y: Int*) = ();
  f()
}
Martin  edited on  2004-06-30 19:11:33.0