diff --git a/src/main/scala-3/com/sksamuel/scapegoat/inspections/traits/AbstractTrait.scala b/src/main/scala-3/com/sksamuel/scapegoat/inspections/traits/AbstractTrait.scala index 6ecc7370..ee089c99 100644 --- a/src/main/scala-3/com/sksamuel/scapegoat/inspections/traits/AbstractTrait.scala +++ b/src/main/scala-3/com/sksamuel/scapegoat/inspections/traits/AbstractTrait.scala @@ -1,22 +1,21 @@ package com.sksamuel.scapegoat.inspections.traits import com.sksamuel.scapegoat.* -import dotty.tools.dotc.ast.Trees.* import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.Context import dotty.tools.dotc.core.Flags -import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types.TypeRef import dotty.tools.dotc.core.Symbols.ClassSymbol import dotty.tools.dotc.util.SourcePosition class AbstractTrait - extends Inspection( - text = "Use of abstract trait", - defaultLevel = Levels.Info, - description = "Traits are automatically abstract.", - explanation = "The abstract modifier is used in class definitions. It is redundant for traits, and mandatory for all other classes which have incomplete members." - ) { + extends Inspection( + text = "Use of abstract trait", + defaultLevel = Levels.Info, + description = "Traits are automatically abstract.", + explanation = + "The abstract modifier is used in class definitions. It is redundant for traits, and mandatory for all other classes which have incomplete members." + ) { import tpd.* @@ -26,7 +25,8 @@ class AbstractTrait tree match { case tDef: TypeDef => tDef.tpe match { - case TypeRef(_, kls: ClassSymbol) if kls.flags.is(Flags.Trait) && kls.flags.is(Flags.Abstract) => + case TypeRef(_, kls: ClassSymbol) + if kls.flags.is(Flags.Trait) && kls.flags.is(Flags.Abstract) => feedback.warn(tree.sourcePos, self, tree.asSnippet) case _ => }