-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymorestat:fixed in nightlyThis issue may be present in the latest stable or RC version of Next, but has been since fixed.This issue may be present in the latest stable or RC version of Next, but has been since fixed.
Milestone
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
He-Pin, usommerl and ahjohannessen
Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymorestat:fixed in nightlyThis issue may be present in the latest stable or RC version of Next, but has been since fixed.This issue may be present in the latest stable or RC version of Next, but has been since fixed.