Skip to content

Commit bea10f2

Browse files
committed
Merge pull request scala#4019 from Ichoran/issue/6192
SI-6192 Range: to, until and end are confusing
2 parents 9c39386 + 4df7057 commit bea10f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/library/scala/collection/immutable/Range.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ import scala.collection.parallel.immutable.ParRange
3333
* `init`) are also permitted on overfull ranges.
3434
*
3535
* @param start the start of this range.
36-
* @param end the exclusive end of the range.
36+
* @param end the end of the range. For exclusive ranges, e.g.
37+
* `Range(0,3)` or `(0 until 3)`, this is one
38+
* step past the last one in the range. For inclusive
39+
* ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`,
40+
* it may be in the range if it is not skipped by the step size.
41+
* To find the last element inside a non-empty range,
42+
use `last` instead.
3743
* @param step the step for the range.
3844
*
3945
* @author Martin Odersky

0 commit comments

Comments
 (0)