Open
Description
Compiler version
3.7.0
3.7.1-RC1
Fixed in 3.7.2-RC1-NIGHTLY
Bisect points it was fixed in 32defdf
Minimized code
//> using options -Wunused:all
trait MonadThrow[F[_]]
extension [T](value: T) def liftTo[F[_]](using MonadThrow[F]): F[T] = ???
trait Api[F[_]]:
def setMaxAge(value: Int): F[Unit]
def truncate(): F[Unit]
trait MetaStreamsSyntax:
extension [F[_]](ms: Api[F])(using MonadThrow[F]) // warns:
def withMaxAge(): F[Unit] =
val lifted = 0.liftTo[F] // uses MonadThrow
assert(lifted != null) // to enusre this val is used
assert(ms != null) // to ensure ms is used
???
def truncated(): F[Unit] =
ms.truncate() // required to trigger warning, does not warn if ms is not used
Output
[warn] ./example.scala:11:38
[warn] unused implicit parameter
[warn] extension [F[_]](ms: Api[F])(using MonadThrow[F])
[warn]
Expectation
Should not warn. Bisected fix should be backported to 3.7.1-RC2 and regression test should be added