diff options
author | Martin Odersky <odersky@gmail.com> | 2012-03-06 17:48:42 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-03-06 17:50:40 +0100 |
commit | 1e9277689461452c594dc547dc0b0ceab8cd3e7d (patch) | |
tree | 07a4cb55a4f90d05dcd093e3d7b562ba28513e6d /src/library/scala/Product2.scala | |
parent | fa55e4f0f8d2834becdb9a9aef9c3ea65cb31fee (diff) | |
download | scala-1e9277689461452c594dc547dc0b0ceab8cd3e7d.tar.gz scala-1e9277689461452c594dc547dc0b0ceab8cd3e7d.tar.bz2 scala-1e9277689461452c594dc547dc0b0ceab8cd3e7d.zip |
Fixes to value classes: Flags now double definitions, private constructors as errors. Fixed erasure scheme.
Diffstat (limited to 'src/library/scala/Product2.scala')
-rw-r--r-- | src/library/scala/Product2.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/Product2.scala b/src/library/scala/Product2.scala index 8097245926..eb67e5d46e 100644 --- a/src/library/scala/Product2.scala +++ b/src/library/scala/Product2.scala @@ -17,13 +17,13 @@ object Product2 { /** Product2 is a cartesian product of 2 components. * @since 2.3 */ -trait Product2[@specialized(Int, Long, Double) +T1, @specialized(Int, Long, Double) +T2] extends Product { +trait Product2[@specialized(Int, Long, Double) +T1, @specialized(Int, Long, Double) +T2] extends Any with Product { /** The arity of this product. * @return 2 */ override def productArity = 2 - + /** Returns the n-th projection of this product if 0 < n <= productArity, * otherwise throws an `IndexOutOfBoundsException`. * @@ -33,7 +33,7 @@ trait Product2[@specialized(Int, Long, Double) +T1, @specialized(Int, Long, Doub */ @throws(classOf[IndexOutOfBoundsException]) - override def productElement(n: Int) = n match { + override def productElement(n: Int) = n match { case 0 => _1 case 1 => _2 case _ => throw new IndexOutOfBoundsException(n.toString()) |