Closed esgott closed 7 months ago
Scala version: 2.13.12
build.sbt:
build.sbt
scalaVersion := "2.13.12" addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1") scalacOptions ++= Seq( "-Wunused" )
src.scala:
src.scala
object src { val foo = for { a <- Some("a") if a == "b" } yield () }
a is actually used, but it's reported as unused
a
[warn] src.scala:3:5: parameter a in anonymous function is never used [warn] a <- Some("a") [warn] ^ [warn] one warning found
Actually, you don't even need the better-monadic-for plugin. I assumed it must be in connection with that, but the warning is there even without that.
Duplicates https://github.com/scala/bug/issues/10287
Reproduction steps
Scala version: 2.13.12
build.sbt
:src.scala
:Problem
a
is actually used, but it's reported as unused