summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-04-21 20:32:45 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-04-21 20:32:45 +0200
commit9ecb5c6423e55bd728621f79daf0c7c927bf41df (patch)
treeeb3db2d2e414445774c520feb3a30516a22bec32 /test/files/neg
parent7753e60685f08d0a7f6c3bed24dab7f2811a5f28 (diff)
parent92460c57eb7a0a8cfcff563d868aa39015f0b764 (diff)
downloadscala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.tar.gz
scala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.tar.bz2
scala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.zip
Merge pull request #3658 from adriaanm/t8450
SI-8450 no "implicit numeric widening" in silent mode
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t8450.check6
-rw-r--r--test/files/neg/t8450.flags1
-rw-r--r--test/files/neg/t8450.scala12
3 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t8450.check b/test/files/neg/t8450.check
new file mode 100644
index 0000000000..eeabb9730c
--- /dev/null
+++ b/test/files/neg/t8450.check
@@ -0,0 +1,6 @@
+t8450.scala:5: warning: implicit numeric widening
+ def elapsed: Foo = (System.nanoTime - 100L).foo
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t8450.flags b/test/files/neg/t8450.flags
new file mode 100644
index 0000000000..9a1332d7af
--- /dev/null
+++ b/test/files/neg/t8450.flags
@@ -0,0 +1 @@
+-Ywarn-numeric-widen -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t8450.scala b/test/files/neg/t8450.scala
new file mode 100644
index 0000000000..f20ed2bc31
--- /dev/null
+++ b/test/files/neg/t8450.scala
@@ -0,0 +1,12 @@
+trait Foo
+
+class WarnWidening {
+ implicit class FooDouble(d: Double) { def foo = new Foo {} }
+ def elapsed: Foo = (System.nanoTime - 100L).foo
+}
+
+class NoWarnWidening {
+ implicit class FooLong(l: Long) { def foo = new Foo {} }
+ implicit class FooDouble(d: Double) { def foo = new Foo {} }
+ def elapsed: Foo = (System.nanoTime - 100L).foo
+}