summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t7877.check7
-rw-r--r--test/files/neg/t7877.scala13
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/t7877.check b/test/files/neg/t7877.check
new file mode 100644
index 0000000000..7f7f832463
--- /dev/null
+++ b/test/files/neg/t7877.check
@@ -0,0 +1,7 @@
+t7877.scala:6: error: not found: value Y
+ case Y() => () // not allowed
+ ^
+t7877.scala:7: error: OnNext[Any] does not take parameters
+ case OnNext[Any]() => () // should *not* be allowed, but was.
+ ^
+two errors found
diff --git a/test/files/neg/t7877.scala b/test/files/neg/t7877.scala
new file mode 100644
index 0000000000..52e167f3b8
--- /dev/null
+++ b/test/files/neg/t7877.scala
@@ -0,0 +1,13 @@
+class Test {
+ val X: OnNext[Any] = null
+ def Y: OnNext[Any] = null
+ (null: Any) match {
+ case X() => () // allowed
+ case Y() => () // not allowed
+ case OnNext[Any]() => () // should *not* be allowed, but was.
+ }
+}
+
+class OnNext[+T] {
+ def unapply(x: Any) = false
+}