diff options
author | Paul Phillips <paulp@improving.org> | 2009-09-11 17:08:43 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-09-11 17:08:43 +0000 |
commit | f9394a4d472887c4563e768467170a9b1677d5c1 (patch) | |
tree | 801fa248907e6c4b611eb35760b4ad641dfb05a6 /test/files/pos | |
parent | 514ff83e3983d81f8bf948abebbe5b9141d9690d (diff) | |
download | scala-f9394a4d472887c4563e768467170a9b1677d5c1.tar.gz scala-f9394a4d472887c4563e768467170a9b1677d5c1.tar.bz2 scala-f9394a4d472887c4563e768467170a9b1677d5c1.zip |
Made canEqual abstract in Product and only inse...
Made canEqual abstract in Product and only inserted into case classes if
no concrete implementation is inherited. Restored the disabled canEquals
usages in collections.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/unapplyComplex.scala | 4 | ||||
-rw-r--r-- | test/files/pos/unapplyGeneric.scala | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/files/pos/unapplyComplex.scala b/test/files/pos/unapplyComplex.scala index 886e265978..70158348c3 100644 --- a/test/files/pos/unapplyComplex.scala +++ b/test/files/pos/unapplyComplex.scala @@ -1,4 +1,6 @@ -trait Complex extends Product2[Double, Double] +trait Complex extends Product2[Double, Double] { + def canEqual(other: Any) = other.isInstanceOf[Complex] +} class ComplexRect(val _1: Double, val _2: Double) extends Complex { override def toString = "ComplexRect("+_1+","+_2+")" diff --git a/test/files/pos/unapplyGeneric.scala b/test/files/pos/unapplyGeneric.scala index bf88816885..987efdd956 100644 --- a/test/files/pos/unapplyGeneric.scala +++ b/test/files/pos/unapplyGeneric.scala @@ -2,7 +2,9 @@ object Bar { def unapply[A,B](bar:Bar[A,B]) = Some(bar) } -class Bar[A,B](val _1:A, val _2:B) extends Product2[A,B] +class Bar[A,B](val _1:A, val _2:B) extends Product2[A,B] { + def canEqual(other: Any) = other.isInstanceOf[Bar[_,_]] +} object Test { new Bar(2, 'a') match { |