Aladdin - Scala Bugtracking
[#274] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-01-15 16:38:19.0
subject compound types with single types crash the compiler
code
trait Test {
  type T;
  val x: T;
  val y: T;
  type X <: x.type with y.type;
}
what happened
Exception in thread "main" java.lang.AssertionError: class Test. Test.this.x.type value x -1
	at scalac.symtab.TypeSymbol.adjustType(Symbol.java:1653)
	at scalac.symtab.TypeSymbol.adjustType(Symbol.java:1658)
	at scalac.symtab.TypeSymbol.computeClosureAt(Symbol.java:1621)
	at scalac.symtab.TypeSymbol.closure(Symbol.java:1579)
	at scalac.typechecker.RefCheck.validateBaseTypes(RefCheck.java:333)
	at scalac.typechecker.RefCheck.transform(RefCheck.java:1015)
	at scalac.ast.Transformer.transform(Transformer.java:120)
	at scalac.typechecker.RefCheck.transform(RefCheck.java:963)
	at scalac.typechecker.RefCheck.transformStat(RefCheck.java:933)
	at scalac.typechecker.RefCheck.transformStats(RefCheck.java:890)
	at scalac.typechecker.RefCheck.transform(RefCheck.java:971)
	at scalac.ast.Transformer.transform(Transformer.java:272)
	at scalac.ast.Transformer.transform(Transformer.java:86)
	at scalac.typechecker.RefCheck.transform(RefCheck.java:945)
	at scalac.typechecker.RefCheck.transformStat(RefCheck.java:933)
	at scalac.typechecker.RefCheck.transformStats(RefCheck.java:890)
	at scalac.typechecker.RefCheck.apply(RefCheck.java:54)
	at scalac.typechecker.RefCheckPhase.apply(RefCheckPhase.java:26)
	at scalac.Global.compile(Global.java:306)
	at scalac.Global.compile(Global.java:278)
	at scala.tools.scalac.Main$.main(sources/scala/tools/scalac/Main.scala:33)
	at scala.tools.scalac.Main.main(sources/scala/tools/scalac/Main.scala)
what expected

Don't know but not a compiler crash.

[back to overview]
Changes of this bug report
Martin  edited on  2004-01-20 12:35:51.0
The compiler nows rejects the illegal type.
Martin  edited on  2004-01-20 12:36:19.0