From b501cb82cd85743a4479efa14a993a1502565775 Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Thu, 11 Feb 2016 13:33:17 +0000 Subject: Fix off-by-one documentation error in Product 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(:10) --- src/build/genprod.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/build') 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 -- cgit v1.2.3