Aladdin - Scala Bugtracking
[#444] project: compiler priority: high category: bug
submitter assigned to status date submitted
Gilles Burak fixed 2005-06-13 13:43:35.0
subject New instance with overriden members in conditional match case body fails
code
class D;
object Test with Application {
  val tata = 1;
  tata match {
    case 1 | 2 => new D {}
  }
}
what happened
Exception in thread "main" scalac.ApplicationError: overloadWith inapplicable for <template>
        at scalac.symtab.Symbol.overloadWith(Symbol.java:1699)
        at scalac.symtab.Scope.enterOrOverload(Scope.java:177)
        at scalac.transformer.AddInterfacesPhase.transformInfo(AddInterfacesPhase.java:65)
        at scalac.symtab.Symbol.transformInfo(Symbol.java:1430)
        at scalac.symtab.Symbol.rawInfoAt(Symbol.java:1367)
        at scalac.symtab.Symbol.rawInfo(Symbol.java:1341)
        at scalac.symtab.Symbol.info(Symbol.java:1315)
        at scalac.symtab.Symbol.nextInfo(Symbol.java:1322)
        at scalac.transformer.AddInterfaces.getClassTree(AddInterfaces.java:230)
        at scalac.transformer.AddInterfaces.template(AddInterfaces.java:175)
        at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:119)
        at scalac.ast.GenTransformer.transform(Transformer.java:456)
        at scalac.transformer.AddInterfaces.template(AddInterfaces.java:160)
        at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:119)
        at scalac.ast.GenTransformer.apply(Transformer.java:405)
        at scalac.transformer.AddInterfacesPhase.apply(AddInterfacesPhase.java:29)
        at scalac.CompilationLoop.loop(CompilationLoop.java:102)
        at scalac.CompilationLoop.compile(CompilationLoop.java:60)
        at scalac.Global.compile(Global.java:391)
        at scalac.Global.compile(Global.java:366)
        at scala.tools.scalac.Main$.main1(Main.scala:47)
        at scala.tools.scalac.Main$.main(Main.scala:28)
        at scala.tools.scalac.Main.main(Main.scala:28)
It does work for:
  tata match {
    case 1 => new D {}
  }
Or:
  tata match {
    case 1 | 2 => new D;
  }
what expected A sucessful compilation.
[back to overview]
Changes of this bug report
Gilles  edited on  2005-06-13 13:47:13.0
Gilles  edited on  2005-06-13 14:25:30.0
Actually, this bug had been corrected in the very latest version of scalac (13 June 2005).