Skip to content

Commit 61cdcae

Browse files
som-snytttgodzik
authored andcommitted
Remove unused code
1 parent 74aafdc commit 61cdcae

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import dotty.tools.dotc.core.Names.{Name, SimpleName, DerivedName, TermName, ter
1010
import dotty.tools.dotc.core.NameOps.{isAnonymousFunctionName, isReplWrapperName, isContextFunction, setterName}
1111
import dotty.tools.dotc.core.NameKinds.{
1212
BodyRetainerName, ContextBoundParamName, ContextFunctionParamName, DefaultGetterName, WildcardParamName}
13+
import dotty.tools.dotc.core.Scopes.newScope
1314
import dotty.tools.dotc.core.StdNames.nme
1415
import dotty.tools.dotc.core.Symbols.{ClassSymbol, NoSymbol, Symbol, defn, isDeprecated, requiredClass, requiredModule}
1516
import dotty.tools.dotc.core.Types.*
@@ -702,8 +703,7 @@ object CheckUnused:
702703
import scala.jdk.CollectionConverters.given
703704
import Rewrites.ActionPatch
704705
type ImpSel = (Import, ImportSelector)
705-
def isUsable(imp: Import, sel: ImportSelector): Boolean =
706-
sel.isImportExclusion || infos.sels.containsKey(sel) || imp.isLoose(sel)
706+
def isUsed(sel: ImportSelector): Boolean = infos.sels.containsKey(sel)
707707
def warnImport(warnable: ImpSel, actions: List[CodeAction] = Nil): Unit =
708708
val (imp, sel) = warnable
709709
val msg = UnusedSymbol.imports(actions)
@@ -1003,12 +1003,6 @@ object CheckUnused:
10031003
def boundTpe: Type = sel.bound match
10041004
case untpd.TypedSplice(tree) => tree.tpe
10051005
case _ => NoType
1006-
/** This is used to ignore exclusion imports of the form import `qual.member as _`
1007-
* because `sel.isUnimport` is too broad for old style `import concurrent._`.
1008-
*/
1009-
def isImportExclusion: Boolean = sel.renamed match
1010-
case untpd.Ident(nme.WILDCARD) => true
1011-
case _ => false
10121006

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

0 commit comments

Comments
 (0)