scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

Don't warn unused param of implicit marker #12935

Closed som-snytt closed 3 months ago

som-snytt commented 5 months ago

Reproduction steps

Scala version: 2.13.12

//> using options -Wunused:implicits

trait CanEqual[A, B]

class EqTest {
  implicit class ArrowAssert[A](a: A) {
    def ==>[B](b: B)(implicit ev: CanEqual[A, B]): Boolean = a == b // no warn, no declared members
  }
}

Problem

Warning is omitted for certain well-known type classes (=:=, etc). It would be nice to not warn if the typeclass declares no members, as no usage is meaningful except passing it down the stack.

som-snytt commented 4 months ago

Thanks, I needed something to do after today's wordle in 3. If only I'd done it in time for 2.13.13.

som-snytt commented 4 months ago

I was nerd-sniped into fixing this twice.