diff options
author | Martin Odersky <odersky@gmail.com> | 2009-02-13 11:59:49 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-02-13 11:59:49 +0000 |
commit | 04840e2ed4530df9a5ca59b984bf2b37a976dc70 (patch) | |
tree | 61394762e202f8ab60e0d3a8e8ac688404241bc3 /src/library/scalax/collection/generic/IterableFactory.scala | |
parent | 708baf94764e2a839e24ca6204060a8d0664d88c (diff) | |
download | scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.tar.gz scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.tar.bz2 scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.zip |
new version of collection libraries
Diffstat (limited to 'src/library/scalax/collection/generic/IterableFactory.scala')
-rwxr-xr-x | src/library/scalax/collection/generic/IterableFactory.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scalax/collection/generic/IterableFactory.scala b/src/library/scalax/collection/generic/IterableFactory.scala index 9570970abe..0cf9c8ac95 100755 --- a/src/library/scalax/collection/generic/IterableFactory.scala +++ b/src/library/scalax/collection/generic/IterableFactory.scala @@ -8,7 +8,7 @@ trait IterableFactory[CC[A] <: Iterable[A]] { protected def newBuilder[A]: Builder[CC, A] = apply().newBuilder[A].asInstanceOf[Builder[CC, A]] - // can't have an empty here because it is defined in subclass covariant.IterableFactory with type + // can't have an empty here because it is defined in subclass EmptyIterableFactory with type // CC[Nothing]. This type does not make sense for immutable iterables. /** Concatenate all the argument lists into a single list. @@ -88,10 +88,10 @@ trait IterableFactory[CC[A] <: Iterable[A]] { * increasing n. If `step > 0` the sequence terminates * with the largest value less than `end`. If `step < 0` * the sequence terminates with the smallest value greater than `end`. - * If `step == 0`, the sequence gors on infinitely (in that - * case the `range` operation might not terminate. + * If `step == 0`, an IllegalArgumentException is thrown. */ def range(start: Int, end: Int, step: Int): CC[Int] = { + if (step == 0) throw new IllegalArgumentException("zero step") val b = newBuilder[Int] var i = start while ((step <= 0 || i < end) && (step >= 0 || i > end)) { |