diff options
author | Janek Bogucki <janekdb@gmail.com> | 2016-02-11 13:33:17 +0000 |
---|---|---|
committer | Janek Bogucki <janekdb@gmail.com> | 2016-02-11 13:40:00 +0000 |
commit | b501cb82cd85743a4479efa14a993a1502565775 (patch) | |
tree | 5dd73b02c32f96eaf222fab88ef6a2fb46cfd3a6 /src/build/genprod.scala | |
parent | c0a6ab2376f08013c923de4e10bfdb925d0ee728 (diff) | |
download | scala-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/build/genprod.scala')
-rw-r--r-- | src/build/genprod.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/build/genprod.scala b/src/build/genprod.scala index b470348e8c..f85a151ae5 100644 --- a/src/build/genprod.scala +++ b/src/build/genprod.scala @@ -15,7 +15,6 @@ import scala.language.postfixOps * where the argument is the desired output directory * * @author Burak Emir, Stephane Micheloud, Geoffrey Washburn, Paul Phillips - * @version 1.1 */ object genprod extends App { val MAX_ARITY = 22 @@ -353,7 +352,7 @@ object ProductTwo extends Product(2) class Product(val i: Int) extends Group("Product") with Arity { val productElementComment = """ - /** 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 |