Aladdin - Scala Bugtracking
[#39] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Martin fixed 2003-06-19 16:12:21.0
subject Illegal "illegal cyclic reference"
code
abstract class Extensible[A, This <: Extensible[A, This]](x: A, xs: This): This {
	def mkObj(x: A, xs: This): This;
}
class Fixed[A](x: A, xs: Fixed[A]) extends Extensible[A, Fixed[A]](x, xs) {
	def mkObj(x: A, xs: Fixed[A]) = new Fixed(x, xs);
}
what happened
Compiling the code above yields the error "illegal cyclic reference involving class scala.SingleLinkedList" (whi\
ch points to the Fixed reference in the superclass of Fixed).
what expected I can't see why the program above is supposed to be illegal. Therefore I expected the compiler not to fail.
[back to overview]
Changes of this bug report