summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-11-04 09:14:38 -0800
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-11-04 09:14:38 -0800
commit2c6777fd53b93b95a261aadc87a5cbc03c14d503 (patch)
tree40a987d82aae9aa48ed37f118d14dbfbc6cc4f9c /test
parent98ccb9fea2ef3b4ce2a519ccc55ad61be84a0508 (diff)
parent0bcb9e9169146e3f589c6c9f65cc4a5523b78120 (diff)
downloadscala-2c6777fd53b93b95a261aadc87a5cbc03c14d503.tar.gz
scala-2c6777fd53b93b95a261aadc87a5cbc03c14d503.tar.bz2
scala-2c6777fd53b93b95a261aadc87a5cbc03c14d503.zip
Merge pull request #1565 from retronym/ticket/6567
SI-6567 Warning for Option(implicitView(foo))
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t6567.check9
-rw-r--r--test/files/neg/t6567.flags1
-rw-r--r--test/files/neg/t6567.scala11
3 files changed, 21 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
diff --git a/test/files/neg/t6567.flags b/test/files/neg/t6567.flags
new file mode 100644
index 0000000000..e93641e931
--- /dev/null
+++ b/test/files/neg/t6567.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t6567.scala b/test/files/neg/t6567.scala
new file mode 100644
index 0000000000..650e5e39ae
--- /dev/null
+++ b/test/files/neg/t6567.scala
@@ -0,0 +1,11 @@
+class A
+class B
+
+object Test {
+ val a: A = null
+ implicit def a2b(a: A) = new B
+
+ Option[B](a)
+
+ val b: Option[B] = Option(a)
+}