aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/neg/i1716.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-25 16:38:18 +0700
committerMartin Odersky <odersky@gmail.com>2016-12-25 16:38:18 +0700
commit9a6c0f81526c632022349dd33431cb79e048cbcc (patch)
tree78ddc5c8aad679970356069f1d13e3f48105945c /tests/pending/neg/i1716.scala
parent119725799675ee00d6d3374771765b88e4de67bc (diff)
downloaddotty-9a6c0f81526c632022349dd33431cb79e048cbcc.tar.gz
dotty-9a6c0f81526c632022349dd33431cb79e048cbcc.tar.bz2
dotty-9a6c0f81526c632022349dd33431cb79e048cbcc.zip
Fix #1716: Don't allow wildcards as type arguments to methods
Wildcards don't make sense as type arguments to methods, and I believe to keep things simple this should also apply to method type arguments in patterns. The best way to enforce this is to make use of the existing infrastructure in the parser for topLevelTypes.
Diffstat (limited to 'tests/pending/neg/i1716.scala')
-rw-r--r--tests/pending/neg/i1716.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/pending/neg/i1716.scala b/tests/pending/neg/i1716.scala
new file mode 100644
index 000000000..1a3fd71d0
--- /dev/null
+++ b/tests/pending/neg/i1716.scala
@@ -0,0 +1,9 @@
+object Fail {
+ def f(m: Option[Int]): Unit = {
+ m match {
+ case x @ Some[_] => // error
+ case _ =>
+ }
+ }
+ Some[_] // error
+}