Skip to content

Fix #5270: Make TupleXXL extend Product #5274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion library/src/scala/TupleXXL.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
package scala
import java.util.Arrays.{deepEquals, deepHashCode}

final class TupleXXL private (es: Array[Object]) {
final class TupleXXL private (es: Array[Object]) extends Product {
assert(es.length > 22)

def productElement(n: Int): Any = es(n)
def productArity: Int = es.length

override def toString = elems.mkString("(", ",", ")")
override def hashCode = getClass.hashCode * 41 + deepHashCode(elems)
override def canEqual(that: Any): Boolean = that match {
case that: TupleXXL => that.productArity == this.productArity
case _ => false
}

override def equals(that: Any) = that match {
case that: TupleXXL => deepEquals(this.elems, that.elems)
case _ => false
Expand Down
File renamed without changes.