Aladdin - Scala Bugtracking
[#758] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2006-09-24 16:44:27.0
subject [contrib #211] Type compatibility problem with singleton types
code
trait A { type T; type M >: T }
trait B extends A { val x : String; val u : A { type T = B.this.T } ; type T = x.type; type M = u.M }
what happened
:6 error: error overriding type M in trait A with bounds >: B.this.x.type <: scala.Any;
 type M has incompatible type B.this.u.M
what expected I'd expect the types to be compatible. If x.type is switched to a non-singleton type, everything works. Also, if the "type T = x.type" is removed from B, and I add trait C extends B { type T = x.type } then everything compiles again!
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-09-24 16:44:54.0
Transferred from the contributions and assigned to Martin
Martin  edited on  2006-11-01 11:21:23.0