summaryrefslogtreecommitdiff
path: root/test/files/neg/warn-unused-implicits.scala
blob: 54f924eac002e84b8bb242786148df19579cac86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
}