diff --git a/input/src/main/scala/fix/InterpolationToStringWarnTest.scala b/input/src/main/scala/fix/InterpolationToStringWarnTest.scala index e42052c..5e823a8 100644 --- a/input/src/main/scala/fix/InterpolationToStringWarnTest.scala +++ b/input/src/main/scala/fix/InterpolationToStringWarnTest.scala @@ -10,6 +10,7 @@ object InterpolationToStringWarnTest { def x1(i: Int, a: A) = { s" ${i.toString} b ${i.toString} c" // assert: InterpolationToStringWarn s" ${2.toString} b " // assert: InterpolationToStringWarn + s" ${i.toString()} b " // assert: InterpolationToStringWarn f" ${i.toString} b " s" ${a.toString(i)} b c " } diff --git a/rules/src/main/scala/fix/InterpolationToStringWarn.scala b/rules/src/main/scala/fix/InterpolationToStringWarn.scala index e7e9a76..becbfd4 100644 --- a/rules/src/main/scala/fix/InterpolationToStringWarn.scala +++ b/rules/src/main/scala/fix/InterpolationToStringWarn.scala @@ -45,6 +45,11 @@ private object InterpolationToStringWarn { x @ Term.Name("toString") ) => x + case Term.Apply.After_4_6_0( + Term.Select(_, x @ Term.Name("toString")), + Term.ArgClause(Nil, None) + ) => + x } } }