summaryrefslogtreecommitdiff
path: root/test/files/neg/warn-unused-implicits.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/warn-unused-implicits.scala')
-rw-r--r--test/files/neg/warn-unused-implicits.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/files/neg/warn-unused-implicits.scala b/test/files/neg/warn-unused-implicits.scala
new file mode 100644
index 0000000000..54f924eac0
--- /dev/null
+++ b/test/files/neg/warn-unused-implicits.scala
@@ -0,0 +1,32 @@
+
+trait InterFace {
+ /** Call something. */
+ def call(a: Int, b: String, c: Double)(implicit s: String): Int
+}
+
+trait BadAPI extends InterFace {
+ def f(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // warn
+ println(b + c)
+ a
+ }
+ @deprecated ("no warn in deprecated API", since="yesterday")
+ def g(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // no warn
+ println(b + c)
+ a
+ }
+ override def call(a: Int,
+ b: String,
+ c: Double
+ )(implicit s: String): Int = { // no warn, required by superclass
+ println(b + c)
+ a
+ }
+
+ def i(implicit s: String, t: Int) = t // yes, warn
+}