scalafix
scalafix copied to clipboard
RemoveUnused: Expression parentheses not properly handled after removing unused variable
trafficstars
Removing an unused variable with Scalafix’s RemoveUnused rule leaves unbalanced parentheses in expressions, resulting in invalid syntax.
scala version: 2.13.13 sbt version: 1.10.1 scalafix version: 0.12.1
build.sbt
ThisBuild / scalaVersion := "2.13.13"
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
lazy val root = (project in file("."))
.settings(
name := "Test",
scalacOptions += {
"-Wunused:locals"
}
)
Before
object Main {
def main(args: Array[String]): Unit = {
val a: Int =
(3
+ 4)
}
}
After
object Main {
def main(args: Array[String]): Unit = {
3
+ 4)
}
}
Thanks for the great bug report! I'll try to look at it in the coming days.