Skip to content

Commit 57273a8

Browse files
som-snytttgodzik
authored andcommitted
Remove unused code
1 parent fa7e7a2 commit 57273a8

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

compiler/src/dotty/tools/dotc/transform/CheckUnused.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import dotty.tools.dotc.config.ScalaSettings
77
import dotty.tools.dotc.core.Contexts.*
88
import dotty.tools.dotc.core.Flags.*
99
import dotty.tools.dotc.core.Names.{Name, SimpleName, DerivedName, TermName, termName}
10-
import dotty.tools.dotc.core.NameOps.{isAnonymousFunctionName, isReplWrapperName, isContextFunction, setterName}
1110
import dotty.tools.dotc.core.NameKinds.{
1211
BodyRetainerName, ContextBoundParamName, ContextFunctionParamName, DefaultGetterName, WildcardParamName}
12+
import dotty.tools.dotc.core.NameOps.{isAnonymousFunctionName, isReplWrapperName, isContextFunction, setterName}
1313
import dotty.tools.dotc.core.Scopes.newScope
1414
import dotty.tools.dotc.core.StdNames.nme
1515
import dotty.tools.dotc.core.Symbols.{ClassSymbol, NoSymbol, Symbol, defn, isDeprecated, requiredClass, requiredModule}
@@ -27,7 +27,6 @@ import dotty.tools.dotc.util.chaining.*
2727

2828
import java.util.IdentityHashMap
2929

30-
import scala.annotation.*
3130
import scala.collection.mutable, mutable.{ArrayBuilder, ListBuffer, Stack}
3231

3332
import CheckUnused.*
@@ -693,9 +692,6 @@ object CheckUnused:
693692
import Rewrites.ActionPatch
694693
type ImpSel = (Import, ImportSelector)
695694
def isUsed(sel: ImportSelector): Boolean = infos.sels.containsKey(sel)
696-
@unused // avoid merge conflict
697-
def isUsable(imp: Import, sel: ImportSelector): Boolean =
698-
sel.isImportExclusion || infos.sels.containsKey(sel)
699695
def warnImport(warnable: ImpSel, actions: List[CodeAction] = Nil): Unit =
700696
val (imp, sel) = warnable
701697
val msg = UnusedSymbol.imports(actions)
@@ -993,11 +989,6 @@ object CheckUnused:
993989
def boundTpe: Type = sel.bound match
994990
case untpd.TypedSplice(tree) => tree.tpe
995991
case _ => NoType
996-
/** Is a "masking" import of the form import `qual.member as _`.
997-
* Both conditions must be checked.
998-
*/
999-
@unused // matchingSelector checks isWildcard first
1000-
def isImportExclusion: Boolean = sel.isUnimport && !sel.isWildcard
1001992

1002993
extension (imp: Import)(using Context)
1003994
/** Is it the first import clause in a statement? `a.x` in `import a.x, b.{y, z}` */

0 commit comments

Comments
 (0)