summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-19 19:44:58 -0700
committerPaul Phillips <paulp@improving.org>2012-03-19 20:13:36 -0700
commit365bb2b4e3ac880243736bf039b649a63b00ccb2 (patch)
tree02dbea778484a2dd33bb7112f834ae3aebf2d07b /test/files
parentc82ecabad6fc050411495f3fd50c3bf79ac7e96e (diff)
downloadscala-365bb2b4e3ac880243736bf039b649a63b00ccb2.tar.gz
scala-365bb2b4e3ac880243736bf039b649a63b00ccb2.tar.bz2
scala-365bb2b4e3ac880243736bf039b649a63b00ccb2.zip
Discovered filter was still being generated.
Rather than withFilter, for a subset of for comprehension structures. Not sure if this was somewhat by design - only seems possible because refchecks was only looking for nme.filter, not nme.withFilter, so perhaps this was intended as some secret irrefutability backchannel? Really have to document that sort of thing if it's intentional. I assumed it wasn't and unified everything.
Diffstat (limited to 'test/files')
-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
+ }
+}