Aladdin - Scala Bugtracking
[#62] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Martin Michel fixed 2003-07-08 18:05:29.0
subject non-primary constructors
code
object m {
  class C(x: int) {
    def y = x;
  }
  constr C1(): C = C(1);
  System.out.println(new C1().y);
}
what happened
Exception in thread "main" java.lang.AssertionError: m.C1 is not a class (kind 5)
	at scalac.transformer.AddInterfacesPhase.needInterface(AddInterfacesPhase.java:183)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:180)
	at scalac.ast.Transformer.transform(Transformer.java:190)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:242)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:67)
	at scalac.ast.Transformer.transform(Transformer.java:140)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:238)
	at scalac.ast.Transformer.transform(Transformer.java:244)
	at scalac.ast.Transformer.transform(Transformer.java:181)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:209)
	at scalac.ast.Transformer.transform(Transformer.java:200)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:186)
	at scalac.ast.Transformer.transform(Transformer.java:190)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:242)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:67)
	at scalac.ast.Transformer.transform(Transformer.java:190)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:242)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:67)
	at scalac.ast.Transformer.transform(Transformer.java:140)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:234)
	at scalac.ast.Transformer.transform(Transformer.java:244)
	at scalac.ast.Transformer.transform(Transformer.java:89)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:117)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:67)
	at scalac.ast.Transformer.apply(Transformer.java:71)
	at scalac.ast.Transformer.apply(Transformer.java:66)
	at scalac.ast.Transformer.apply(Transformer.java:62)
	at scalac.transformer.AddInterfacesPhase.apply(AddInterfacesPhase.java:35)
	at scalac.Global.compile(Global.java:268)
	at scalac.Global.compile(Global.java:244)
	at scalac.Main.main(Main.java:32)
what expected auxiliary constructors should compile correctly.
[back to overview]
Changes of this bug report
Michel  edited on  2003-08-28 09:50:59.0
Non-primary constructors now appear to work (thanks to Nikolay).