From 120e27dba8aa0863e6a38e65a3f51f5a837c0579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sat, 9 Sep 2023 22:04:14 +0200 Subject: [PATCH] Explicit type declaration for postTyperTraverser --- .../scapegoat/inspections/FinalModifierOnCaseClass.scala | 6 +++--- .../inspections/RedundantFinalModifierOnMethod.scala | 2 +- .../scapegoat/inspections/RedundantFinalModifierOnVar.scala | 2 +- .../scala/com/sksamuel/scapegoat/inspections/VarUse.scala | 2 +- .../collections/FindAndNotEqualsNoneReplaceWithExists.scala | 2 +- .../scapegoat/inspections/collections/PreferMapEmpty.scala | 2 +- .../inspections/controlflow/RepeatedIfElseBody.scala | 2 +- .../inspections/string/LooksLikeInterpolatedString.scala | 2 +- .../scapegoat/inspections/unsafe/AsInstanceOf.scala | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala index 72c28c0d..d544dca4 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala @@ -10,12 +10,12 @@ class FinalModifierOnCaseClass explanation = "Using case classes without final modifier can lead to surprising breakage." ) { - override def inspector(context: InspectionContext): Inspector = - new Inspector(context) { + override def inspector(ctx: InspectionContext): Inspector = + new Inspector(ctx) { import context.global._ - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { override def inspect(tree: Tree): Unit = { diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala index 9208a3a6..6d88435c 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala @@ -18,7 +18,7 @@ class RedundantFinalModifierOnMethod import context.global._ import definitions._ - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { override def inspect(tree: Tree): Unit = { diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala index 234c44e9..7cbc7f96 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala @@ -15,7 +15,7 @@ class RedundantFinalModifierOnVar import context.global._ - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { override def inspect(tree: Tree): Unit = { diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala index ad0fd528..c5ba010f 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala @@ -13,7 +13,7 @@ class VarUse def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._ diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala index 679dc3ac..a6e67e4e 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala @@ -12,7 +12,7 @@ class FindAndNotEqualsNoneReplaceWithExists def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._ diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala index 05af8b8f..7c734b01 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala @@ -13,7 +13,7 @@ class PreferMapEmpty def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._ diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala index 8485eb43..d331a79d 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala @@ -13,7 +13,7 @@ class RepeatedIfElseBody def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._ diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala index a53e9e09..0f726f20 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala @@ -15,7 +15,7 @@ class LooksLikeInterpolatedString def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._ diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala index 9a260783..a4b2e3ea 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala @@ -13,7 +13,7 @@ class AsInstanceOf def inspector(ctx: InspectionContext): Inspector = new Inspector(ctx) { - override def postTyperTraverser = + override def postTyperTraverser: context.Traverser = new context.Traverser { import context.global._