summaryrefslogtreecommitdiff
path: root/test/files/neg/t6567.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-03 16:19:46 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-03 16:27:15 +0100
commit0bcb9e9169146e3f589c6c9f65cc4a5523b78120 (patch)
tree6fb37c99eb90de4e13850edbfddfcb2dca6be0ea /test/files/neg/t6567.check
parent0475fbd6e0cad15460d87eda52c9487f7ff171d3 (diff)
downloadscala-0bcb9e9169146e3f589c6c9f65cc4a5523b78120.tar.gz
scala-0bcb9e9169146e3f589c6c9f65cc4a5523b78120.tar.bz2
scala-0bcb9e9169146e3f589c6c9f65cc4a5523b78120.zip
SI-6567 Warning for Option(implicitView(foo))
I've seen the reported problem before in the wild. It seems worthy of a special warning, so long as we advocate Option.apply as an alternative to `if (x == null) Some(x) else None`. It is behind -Xlint at the moment, an option that could do with some promotion.
Diffstat (limited to 'test/files/neg/t6567.check')
-rw-r--r--test/files/neg/t6567.check9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/neg/t6567.check b/test/files/neg/t6567.check
new file mode 100644
index 0000000000..a733d75354
--- /dev/null
+++ b/test/files/neg/t6567.check
@@ -0,0 +1,9 @@
+t6567.scala:8: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply.
+ Option[B](a)
+ ^
+t6567.scala:10: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply.
+ val b: Option[B] = Option(a)
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found