Skip to content

Commit

Permalink
remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fntz committed Oct 18, 2024
1 parent 2a3bc47 commit 2e27473
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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.*

Expand All @@ -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 _ =>
}
Expand Down

0 comments on commit 2e27473

Please sign in to comment.