diff --git a/input/src/main/scala-3/fix/UnusedConstructorParamsTest2.scala b/input/src/main/scala-3/fix/UnusedConstructorParamsTest2.scala new file mode 100644 index 0000000..0b9e5b8 --- /dev/null +++ b/input/src/main/scala-3/fix/UnusedConstructorParamsTest2.scala @@ -0,0 +1,6 @@ +/* +rule = UnusedConstructorParams + */ +package fix + +class A6(val x: Int)(using x2: String) diff --git a/input/src/main/scala/fix/UnusedConstructorParamsTest.scala b/input/src/main/scala/fix/UnusedConstructorParamsTest.scala index f0a51cb..96aec0a 100644 --- a/input/src/main/scala/fix/UnusedConstructorParamsTest.scala +++ b/input/src/main/scala/fix/UnusedConstructorParamsTest.scala @@ -10,3 +10,5 @@ class A2(x: Int) // assert: UnusedConstructorParams class A3(`type`: Int) extends A1(`type`) class A4(var x: Int) + +class A5(val x: Int)(implicit x2: String) diff --git a/rules/src/main/scala/fix/UnusedConstructorParams.scala b/rules/src/main/scala/fix/UnusedConstructorParams.scala index edcb83a..2c6ff16 100644 --- a/rules/src/main/scala/fix/UnusedConstructorParams.scala +++ b/rules/src/main/scala/fix/UnusedConstructorParams.scala @@ -21,6 +21,7 @@ class UnusedConstructorParams extends SyntacticRule("UnusedConstructorParams") { case x: Defn.Class if !x.mods.exists(_.is[Mod.Case]) => val params = x.ctor.paramClauses.flatten .filterNot(_.mods.exists(_.is[Mod.Implicit])) + .filterNot(_.mods.exists(_.is[Mod.Using])) .filterNot(_.mods.exists(_.is[Mod.VarParam])) .filterNot(_.mods.exists(_.is[Mod.ValParam])) val allTokens = {