diff options
author | Martin Odersky <odersky@gmail.com> | 2009-11-23 14:45:44 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-11-23 14:45:44 +0000 |
commit | 85befd69274d53fb2a4e7b9cdbd8fed8f3171e42 (patch) | |
tree | 63c6509c5f49a49a4d8deb09ad0e81d95550106f /test/files/neg | |
parent | 1e890eacbf99e0ac005c0afd256fa86e9d456d84 (diff) | |
download | scala-85befd69274d53fb2a4e7b9cdbd8fed8f3171e42.tar.gz scala-85befd69274d53fb2a4e7b9cdbd8fed8f3171e42.tar.bz2 scala-85befd69274d53fb2a4e7b9cdbd8fed8f3171e42.zip |
Closed #1226. Added new test cases.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t2641.check | 39 | ||||
-rw-r--r-- | test/files/neg/t2641.scala | 31 |
2 files changed, 70 insertions, 0 deletions
diff --git a/test/files/neg/t2641.check b/test/files/neg/t2641.check new file mode 100644 index 0000000000..70123bfc58 --- /dev/null +++ b/test/files/neg/t2641.check @@ -0,0 +1,39 @@ +t2641.scala:19: error: illegal cyclic reference involving trait ManagedSeq + with TraversableViewLike[A, ManagedSeqStrict[A], ManagedSeq[A]] + ^ +t2641.scala:17: error: illegal inheritance; + self-type ManagedSeq does not conform to ManagedSeqStrict[A]'s selftype ManagedSeqStrict[A] + extends ManagedSeqStrict[A] + ^ +t2641.scala:18: error: illegal inheritance; + self-type ManagedSeq does not conform to scala.collection.TraversableView[A,ManagedSeqStrict[A]]'s selftype scala.collection.TraversableView[A,ManagedSeqStrict[A]] + with TraversableView[A, ManagedSeqStrict[A]] + ^ +t2641.scala:19: error: illegal inheritance; + self-type ManagedSeq does not conform to scala.collection.TraversableViewLike[A,ManagedSeqStrict[A],<error>]'s selftype scala.collection.TraversableViewLike[A,Coll,This] + with TraversableViewLike[A, ManagedSeqStrict[A], ManagedSeq[A]] + ^ +t2641.scala:17: error: illegal inheritance; + self-type ManagedSeq does not conform to ScalaObject's selftype ScalaObject + extends ManagedSeqStrict[A] + ^ +t2641.scala:25: error: something is wrong (wrong class file?): trait ManagedSeq with type parameters [A,Coll] gets applied to arguments [], phase = typer + trait Transformed[+B] extends ManagedSeq[B, Coll] with super.Transformed[B] + ^ +t2641.scala:27: error: something is wrong (wrong class file?): trait ManagedSeq with type parameters [A,Coll] gets applied to arguments [], phase = namer + trait Sliced extends Transformed[A] with super.Sliced { + ^ +t2641.scala:27: error: illegal inheritance; superclass Any + is not a subclass of the superclass ManagedSeqStrict + of the mixin trait Transformed + trait Sliced extends Transformed[A] with super.Sliced { + ^ +t2641.scala:27: error: illegal inheritance; superclass Any + is not a subclass of the superclass Object + of the mixin trait Sliced + trait Sliced extends Transformed[A] with super.Sliced { + ^ +t2641.scala:28: error: value managedIterator is not a member of ManagedSeq + override def managedIterator = self.managedIterator slice (from, until) + ^ +10 errors found diff --git a/test/files/neg/t2641.scala b/test/files/neg/t2641.scala new file mode 100644 index 0000000000..5529035f79 --- /dev/null +++ b/test/files/neg/t2641.scala @@ -0,0 +1,31 @@ +import scala.collection._ +import scala.collection.generic._ +import scala.collection.mutable.Builder + + +abstract class ManagedSeqStrict[+A] + extends Traversable[A] + with GenericTraversableTemplate[A, ManagedSeqStrict] +{ + override def companion: GenericCompanion[ManagedSeqStrict] = null + + override def foreach[U](f: A => U): Unit = + null +} + +trait ManagedSeq[+A, +Coll] + extends ManagedSeqStrict[A] + with TraversableView[A, ManagedSeqStrict[A]] + with TraversableViewLike[A, ManagedSeqStrict[A], ManagedSeq[A]] +{ self => + + override def underlying = throw new Exception("no underlying") + + //trait Transformed[+B] extends ManagedSeq[B] with super.Transformed[B] + trait Transformed[+B] extends ManagedSeq[B, Coll] with super.Transformed[B] + + trait Sliced extends Transformed[A] with super.Sliced { + override def managedIterator = self.managedIterator slice (from, until) + } + +} |