summaryrefslogtreecommitdiff
path: root/src/library/scala/Product1.scala
diff options
context:
space:
mode:
authorJanek Bogucki <janekdb@gmail.com>2016-02-11 13:33:17 +0000
committerJanek Bogucki <janekdb@gmail.com>2016-02-11 13:40:00 +0000
commitb501cb82cd85743a4479efa14a993a1502565775 (patch)
tree5dd73b02c32f96eaf222fab88ef6a2fb46cfd3a6 /src/library/scala/Product1.scala
parentc0a6ab2376f08013c923de4e10bfdb925d0ee728 (diff)
downloadscala-b501cb82cd85743a4479efa14a993a1502565775.tar.gz
scala-b501cb82cd85743a4479efa14a993a1502565775.tar.bz2
scala-b501cb82cd85743a4479efa14a993a1502565775.zip
Fix off-by-one documentation error in Product<N>
Sanity check: scala> case class P2(i: Int, j: Int) defined class P2 val p2 = P2(1, 3) p2.productElement(0) res0: Any = 1 p2.productElement(1) res1: Any = 3 p2.productElement(2) java.lang.IndexOutOfBoundsException: 2 at P2.productElement(<console>:10)
Diffstat (limited to 'src/library/scala/Product1.scala')
-rw-r--r--src/library/scala/Product1.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/Product1.scala b/src/library/scala/Product1.scala
index dbc34ba66a..e82300adf6 100644
--- a/src/library/scala/Product1.scala
+++ b/src/library/scala/Product1.scala
@@ -24,7 +24,7 @@ trait Product1[@specialized(Int, Long, Double) +T1] extends Any with Product {
override def productArity = 1
- /** Returns the n-th projection of this product if 0 < n <= productArity,
+ /** Returns the n-th projection of this product if 0 <= n < productArity,
* otherwise throws an `IndexOutOfBoundsException`.
*
* @param n number of the projection to be returned