summaryrefslogtreecommitdiff
path: root/test/files/neg/t9629.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-01-25 22:11:19 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-01-25 22:40:28 +1000
commitb2093f2345b991fa4774950c5505621ab6445897 (patch)
treeaaa0e87e8aad907d64985cb3aa51cd011ed92b53 /test/files/neg/t9629.check
parent1081e718f8f8e174dbf615e42b157e187d3d3886 (diff)
downloadscala-b2093f2345b991fa4774950c5505621ab6445897.tar.gz
scala-b2093f2345b991fa4774950c5505621ab6445897.tar.bz2
scala-b2093f2345b991fa4774950c5505621ab6445897.zip
SI-9629 Emit missing 'pattern must be a value' error
The error used to only be emitted for top-level patterns. This commit moves it into `typedInternal` so it works for nested patterns. It uses the typer mode to know when to fire.
Diffstat (limited to 'test/files/neg/t9629.check')
-rw-r--r--test/files/neg/t9629.check17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t9629.check b/test/files/neg/t9629.check
new file mode 100644
index 0000000000..4eafa84236
--- /dev/null
+++ b/test/files/neg/t9629.check
@@ -0,0 +1,17 @@
+t9629.scala:4: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case Option[Int] => // error was issued before
+ ^
+t9629.scala:5: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case Some(Option[Int]) => // error was skipped, patmat issued an internal error
+ ^
+t9629.scala:8: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case (_, Option[Int]) =>
+ ^
+t9629.scala:9: error: pattern must be a value: Option[Int]
+Note: if you intended to match against the class, try `case _: Option[_]`
+ case x @ (y @ Option[Int]) =>
+ ^
+four errors found