aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-27 18:04:28 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-27 18:04:28 +0200
commit3129c1c136d5fa8b1549ec940ea1856c135bfe85 (patch)
treeff748f136164a88287fcc672b699bed82c66631e /tests
parented8e2ba6623e755662ef503c0dbda72b40c9e27f (diff)
downloaddotty-3129c1c136d5fa8b1549ec940ea1856c135bfe85.tar.gz
dotty-3129c1c136d5fa8b1549ec940ea1856c135bfe85.tar.bz2
dotty-3129c1c136d5fa8b1549ec940ea1856c135bfe85.zip
Revert: Better error diagnostics for "not an extractor" errors.
No longer needed because we are going to allow dependent method types in extractors, and the unary requirement is kind of obvious.
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/extractors.scala27
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/neg/extractors.scala b/tests/neg/extractors.scala
deleted file mode 100644
index 88600da76..000000000
--- a/tests/neg/extractors.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-object A {}
-
-object B {
-
- def unapply[T](x: T): Option[x.type] = ???
-
-}
-
-object C {
- def unapply[T](x: T, y: T): Option[T] = ???
-}
-
-object D {
- def unapply[T](): Option[T] = ???
-}
-
-object Test {
-
- val x: Any = ???
- x match {
- case A(y) => ??? // error: A cannot be used as an extractor in a pattern it lacks a unapply or unapplySeq method
- case B(y) => ??? // error: B cannot be used as an extractor in a pattern its unapply method of type (x: T)Option[T(x)] has a dependent type
- case C(y) => ??? // error: C cannot be used as an extractor in a pattern its unapply method of type (x: T, y: T)Option[T] does not take a single parameter
- case D(y) => ??? // error: D cannot be used as an extractor in a pattern its unapply method of type ()Option[T] does not take a single parameter
- }
-
-}