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;
}
|