@@ -10,6 +10,7 @@ import dotty.tools.dotc.core.Names.{Name, SimpleName, DerivedName, TermName, ter
10
10
import dotty .tools .dotc .core .NameOps .{isAnonymousFunctionName , isReplWrapperName , isContextFunction , setterName }
11
11
import dotty .tools .dotc .core .NameKinds .{
12
12
BodyRetainerName , ContextBoundParamName , ContextFunctionParamName , DefaultGetterName , WildcardParamName }
13
+ import dotty .tools .dotc .core .Scopes .newScope
13
14
import dotty .tools .dotc .core .StdNames .nme
14
15
import dotty .tools .dotc .core .Symbols .{ClassSymbol , NoSymbol , Symbol , defn , isDeprecated , requiredClass , requiredModule }
15
16
import dotty .tools .dotc .core .Types .*
@@ -702,8 +703,7 @@ object CheckUnused:
702
703
import scala .jdk .CollectionConverters .given
703
704
import Rewrites .ActionPatch
704
705
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)
707
707
def warnImport (warnable : ImpSel , actions : List [CodeAction ] = Nil ): Unit =
708
708
val (imp, sel) = warnable
709
709
val msg = UnusedSymbol .imports(actions)
@@ -1003,12 +1003,6 @@ object CheckUnused:
1003
1003
def boundTpe : Type = sel.bound match
1004
1004
case untpd.TypedSplice (tree) => tree.tpe
1005
1005
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
1012
1006
1013
1007
extension (imp : Import )(using Context )
1014
1008
/** Is it the first import clause in a statement? `a.x` in `import a.x, b.{y, z}` */
0 commit comments