diff options
Diffstat (limited to 'test/files')
-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 { |