Skip to content

Commit 5991804

Browse files
committed
Remove unused code
1 parent 8fc10d0 commit 5991804

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, setterName}
1110
import dotty.tools.dotc.core.NameKinds.{
1211
BodyRetainerName, ContextBoundParamName, ContextFunctionParamName, DefaultGetterName, WildcardParamName}
12+
import dotty.tools.dotc.core.NameOps.{isAnonymousFunctionName, isReplWrapperName, 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.*
@@ -725,9 +724,6 @@ object CheckUnused:
725724
import Rewrites.ActionPatch
726725
type ImpSel = (Import, ImportSelector)
727726
def isUsed(sel: ImportSelector): Boolean = infos.sels.containsKey(sel)
728-
@unused // avoid merge conflict
729-
def isUsable(imp: Import, sel: ImportSelector): Boolean =
730-
sel.isImportExclusion || infos.sels.containsKey(sel)
731727
def warnImport(warnable: ImpSel, actions: List[CodeAction] = Nil): Unit =
732728
val (imp, sel) = warnable
733729
val msg = UnusedSymbol.imports(actions)
@@ -1025,11 +1021,6 @@ object CheckUnused:
10251021
def boundTpe: Type = sel.bound match
10261022
case untpd.TypedSplice(tree) => tree.tpe
10271023
case _ => NoType
1028-
/** Is a "masking" import of the form import `qual.member as _`.
1029-
* Both conditions must be checked.
1030-
*/
1031-
@unused // matchingSelector checks isWildcard first
1032-
def isImportExclusion: Boolean = sel.isUnimport && !sel.isWildcard
10331024

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

0 commit comments

Comments
 (0)