diff options
author | Martin Odersky <odersky@gmail.com> | 2008-12-09 17:40:50 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-12-09 17:40:50 +0000 |
commit | f83d8977544ec7fc3eed59e032e3705f30290c00 (patch) | |
tree | 2109641f8f4d84630726637ed480e0512c99e1d5 /src/library/scalax/collection/generic/covariant | |
parent | 4d32e17513cf46b786eef8523653ac366c73a09c (diff) | |
download | scala-f83d8977544ec7fc3eed59e032e3705f30290c00.tar.gz scala-f83d8977544ec7fc3eed59e032e3705f30290c00.tar.bz2 scala-f83d8977544ec7fc3eed59e032e3705f30290c00.zip |
updates to scalax collections and standard libr...
updates to scalax collections and standard library classes.
Diffstat (limited to 'src/library/scalax/collection/generic/covariant')
-rwxr-xr-x | src/library/scalax/collection/generic/covariant/IterableFactory.scala | 8 | ||||
-rwxr-xr-x | src/library/scalax/collection/generic/covariant/OrderedIterableTemplate.scala | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/library/scalax/collection/generic/covariant/IterableFactory.scala b/src/library/scalax/collection/generic/covariant/IterableFactory.scala index 67445f54d9..0fd2284cea 100755 --- a/src/library/scalax/collection/generic/covariant/IterableFactory.scala +++ b/src/library/scalax/collection/generic/covariant/IterableFactory.scala @@ -7,8 +7,14 @@ trait IterableFactory[CC[+A] <: Iterable[A]] extends generic.IterableFactory[CC] override protected def newBuilder[A]: Builder[CC, A] = empty.newBuilder[A].asInstanceOf[Builder[CC, A]] + // the cast here is unavoidable because CC is not constrained with covariant.IterableTemplate[CC, A] + // It's can't be constrained because some suntype links between covariant and generic Templates + // are missing. That's a consequence of our hacks to have both nonvariant and covariant templates. /** Create CC collection of specified elements */ override def apply[A](args: A*): CC[A] = - (empty ++ args.asInstanceOf[Iterable[A]]).asInstanceOf[CC[A]] // !!! + (empty ++ args.asInstanceOf[Iterable[A]]).asInstanceOf[CC[A]] + // the cast here is unavoidable because CC is not constrained with covariant.IterableTemplate[CC, A] + // It's can't be constrained because some suntype links between covariant and generic Templates + // are missing. That's a consequence of our hacks to have both nonvariant and covariant templates. } diff --git a/src/library/scalax/collection/generic/covariant/OrderedIterableTemplate.scala b/src/library/scalax/collection/generic/covariant/OrderedIterableTemplate.scala index 449bac9cfc..38c1c2ab4c 100755 --- a/src/library/scalax/collection/generic/covariant/OrderedIterableTemplate.scala +++ b/src/library/scalax/collection/generic/covariant/OrderedIterableTemplate.scala @@ -13,5 +13,5 @@ package scalax.collection.generic.covariant import annotation.unchecked.uncheckedVariance -trait OrderedIterableTemplate[+CC[+B] <: OrderedIterableTemplate[CC, B] with OrderedIterable[B], +A] +trait OrderedIterableTemplate[+CC[+B] <: OrderedIterable[B] with OrderedIterableTemplate[CC, B], +A] extends generic.OrderedIterableTemplate[CC, A @uncheckedVariance] {self /*: CC[A]*/ => } |