summaryrefslogtreecommitdiff
path: root/test/files/pos/irrefutable.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-20 20:15:45 -0700
committerPaul Phillips <paulp@improving.org>2012-03-20 20:15:45 -0700
commitfcc63e2b667bdbaddbaacc843de97f8db02f6426 (patch)
tree9ee7bd6e4cb9e487a0d5c5b9c812a68c4c0ed025 /test/files/pos/irrefutable.scala
parent1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836 (diff)
downloadscala-fcc63e2b667bdbaddbaacc843de97f8db02f6426.tar.gz
scala-fcc63e2b667bdbaddbaacc843de97f8db02f6426.tar.bz2
scala-fcc63e2b667bdbaddbaacc843de97f8db02f6426.zip
Restore irrefutability commits.
This reverts commit d8ba5d091e5641553b438ef9930a6023a2709dcd.
Diffstat (limited to 'test/files/pos/irrefutable.scala')
-rw-r--r--test/files/pos/irrefutable.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/pos/irrefutable.scala b/test/files/pos/irrefutable.scala
new file mode 100644
index 0000000000..0a792b644a
--- /dev/null
+++ b/test/files/pos/irrefutable.scala
@@ -0,0 +1,22 @@
+// The test which this should perform but does not
+// is that f1 is recognized as irrefutable and f2 is not
+// This can be recognized via the generated classes:
+//
+// A$$anonfun$f1$1.class
+// A$$anonfun$f2$1.class
+// A$$anonfun$f2$2.class
+//
+// The extra one in $f2$ is the filter.
+//
+// !!! Marking with exclamation points so maybe someday
+// this test will be finished.
+class A {
+ case class Foo[T](x: T)
+
+ def f1(xs: List[Foo[Int]]) = {
+ for (Foo(x: Int) <- xs) yield x
+ }
+ def f2(xs: List[Foo[Any]]) = {
+ for (Foo(x: Int) <- xs) yield x
+ }
+}