summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-07-11 15:17:39 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-07-11 15:17:39 +0000
commit3f2a92765e50f08daed0b310d058a37463e1622f (patch)
tree16bb37ce903a298eabc625f7b66d58f4e6eb1073
parent4b616e2ff3b7484d5d59244463ec1e3844db0c11 (diff)
downloadscala-3f2a92765e50f08daed0b310d058a37463e1622f.tar.gz
scala-3f2a92765e50f08daed0b310d058a37463e1622f.tar.bz2
scala-3f2a92765e50f08daed0b310d058a37463e1622f.zip
Fixes #4709.
Review by extempore.
-rw-r--r--src/library/scala/collection/generic/GenSeqFactory.scala10
-rw-r--r--src/library/scala/collection/generic/SeqFactory.scala2
-rw-r--r--test/files/run/t4709.scala10
3 files changed, 19 insertions, 3 deletions
diff --git a/src/library/scala/collection/generic/GenSeqFactory.scala b/src/library/scala/collection/generic/GenSeqFactory.scala
index 58b76aed45..ee6ecae3c2 100644
--- a/src/library/scala/collection/generic/GenSeqFactory.scala
+++ b/src/library/scala/collection/generic/GenSeqFactory.scala
@@ -11,8 +11,16 @@
package scala.collection
package generic
+import annotation.bridge
+
/** A template for companion objects of Seq and subclasses thereof.
*
* @since 2.8
*/
-abstract class GenSeqFactory[CC[X] <: GenSeq[X] with GenericTraversableTemplate[X, CC]] extends GenTraversableFactory[CC]
+abstract class GenSeqFactory[CC[X] <: GenSeq[X] with GenericTraversableTemplate[X, CC]]
+extends GenTraversableFactory[CC] {
+
+ @bridge
+ def unapplySeq[A](x: GenSeq[A]): Some[GenSeq[A]] = Some(x)
+
+}
diff --git a/src/library/scala/collection/generic/SeqFactory.scala b/src/library/scala/collection/generic/SeqFactory.scala
index c152a89528..7bd92173ff 100644
--- a/src/library/scala/collection/generic/SeqFactory.scala
+++ b/src/library/scala/collection/generic/SeqFactory.scala
@@ -11,8 +11,6 @@
package scala.collection
package generic
-import annotation.bridge
-
/** A template for companion objects of Seq and subclasses thereof.
*
* @since 2.8
diff --git a/test/files/run/t4709.scala b/test/files/run/t4709.scala
new file mode 100644
index 0000000000..c61a440397
--- /dev/null
+++ b/test/files/run/t4709.scala
@@ -0,0 +1,10 @@
+
+
+import collection.GenSeq
+
+
+object Test {
+ def main(args: Array[String]) {
+ val Seq(1, 2) = Stream(1, 2)
+ }
+}