diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-10-06 14:27:27 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-10-06 14:27:27 +0200 |
commit | bea10f23ef2840fa523392f553000a2ac4259cd9 (patch) | |
tree | 5aac72da2f0d1fd45d80467465d2cf9758105903 /src | |
parent | 9c39386f566f97656f687417efff4def07730691 (diff) | |
parent | 4df705745cd2a14de8830ec74c2ec7b5f973ce71 (diff) | |
download | scala-bea10f23ef2840fa523392f553000a2ac4259cd9.tar.gz scala-bea10f23ef2840fa523392f553000a2ac4259cd9.tar.bz2 scala-bea10f23ef2840fa523392f553000a2ac4259cd9.zip |
Merge pull request #4019 from Ichoran/issue/6192
SI-6192 Range: to, until and end are confusing
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/immutable/Range.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala index 720dfeed59..3ae8a2c342 100644 --- a/src/library/scala/collection/immutable/Range.scala +++ b/src/library/scala/collection/immutable/Range.scala @@ -33,7 +33,13 @@ import scala.collection.parallel.immutable.ParRange * `init`) are also permitted on overfull ranges. * * @param start the start of this range. - * @param end the exclusive end of the range. + * @param end the end of the range. For exclusive ranges, e.g. + * `Range(0,3)` or `(0 until 3)`, this is one + * step past the last one in the range. For inclusive + * ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`, + * it may be in the range if it is not skipped by the step size. + * To find the last element inside a non-empty range, + use `last` instead. * @param step the step for the range. * * @author Martin Odersky |