diff options
Diffstat (limited to 'src/library/scalax/collection/generic/covariant/IterableFactory.scala')
-rwxr-xr-x | src/library/scalax/collection/generic/covariant/IterableFactory.scala | 8 |
1 files changed, 7 insertions, 1 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. } |