summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-08-29 10:27:26 -0700
committerPaul Phillips <paulp@improving.org>2013-08-29 10:27:26 -0700
commit7c8b6369aaaac1317a04baeba5df5c47f2d7a731 (patch)
treea40dd8423ccba98ce0f3b38196feedbcdff7b92a /test/files
parent09058cff51cac263e7f476f97c79e6d41ee59cc9 (diff)
downloadscala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.tar.gz
scala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.tar.bz2
scala-7c8b6369aaaac1317a04baeba5df5c47f2d7a731.zip
Limit bad advice given for erroneous pattern.
Don't suggest "_: <none>" as an alternative when the pattern type doesn't conform to the expected type.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/bad-advice.check6
-rw-r--r--test/files/neg/bad-advice.flags1
-rw-r--r--test/files/neg/bad-advice.scala6
3 files changed, 13 insertions, 0 deletions
diff --git a/test/files/neg/bad-advice.check b/test/files/neg/bad-advice.check
new file mode 100644
index 0000000000..03b3e4f616
--- /dev/null
+++ b/test/files/neg/bad-advice.check
@@ -0,0 +1,6 @@
+bad-advice.scala:4: error: pattern type is incompatible with expected type;
+ found : Bip.type
+ required: Int
+ case Bip => true
+ ^
+one error found
diff --git a/test/files/neg/bad-advice.flags b/test/files/neg/bad-advice.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/bad-advice.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/bad-advice.scala b/test/files/neg/bad-advice.scala
new file mode 100644
index 0000000000..b1955330d7
--- /dev/null
+++ b/test/files/neg/bad-advice.scala
@@ -0,0 +1,6 @@
+object Bip
+object Test {
+ def f(x: Int) = x match {
+ case Bip => true
+ }
+}