summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pending/pos/unapplyGeneric.scala11
-rw-r--r--test/pending/pos/unapplySeq.scala6
2 files changed, 13 insertions, 4 deletions
diff --git a/test/pending/pos/unapplyGeneric.scala b/test/pending/pos/unapplyGeneric.scala
new file mode 100644
index 0000000000..3798d0b466
--- /dev/null
+++ b/test/pending/pos/unapplyGeneric.scala
@@ -0,0 +1,11 @@
+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]
+
+object Test {
+ Bar(2, 'a') match {
+ case Bar(x,y) =>
+ }
+}
diff --git a/test/pending/pos/unapplySeq.scala b/test/pending/pos/unapplySeq.scala
index 36cb69cf3d..aac211de5a 100644
--- a/test/pending/pos/unapplySeq.scala
+++ b/test/pending/pos/unapplySeq.scala
@@ -1,10 +1,8 @@
-case class MyTuple2[A,B](val _1:A, val snd:B)
-
object FooSeq {
def unapplySeq(x:Any): Option[Product2[Int,Seq[String]]] = {
if(x.isInstanceOf[Bar]) {
val y = x.asInstanceOf[Bar]
- Some(MyTuple2(y.size, y.name))
+ Some({y.size, y.name})
} else None
}
@@ -23,6 +21,6 @@ object FooSeq {
class Bar {
var size: Int = 50
- var name: List[String] = List("medium","M")
+ var name: Seq[String] = List("medium","M")
}