Skip to content

Commit 5a755dd

Browse files
committed
Reports more import alternatives
- Reports more import alternatives (e.g. overloaded methods)
1 parent 82290c8 commit 5a755dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ object CheckUnused:
356356
/** Given an import and accessibility, return an option of selector that match import<->symbol */
357357
def isInImport(imp: tpd.Import, isAccessible: Boolean)(using Context): Option[ImportSelector] =
358358
val tpd.Import(qual, sels) = imp
359-
val qualHasSymbol = qual.tpe.member(sym.name).symbol == sym
359+
val qualHasSymbol = qual.tpe.member(sym.name).alternatives.map(_.symbol).contains(sym)
360360
def selector = sels.find(sel => sel.name.toTermName == sym.name || sel.name.toTypeName == sym.name)
361361
def wildcard = sels.find(sel => sel.isWildcard && ((sym.is(Given) == sel.isGiven) || sym.is(Implicit)))
362362
if qualHasSymbol && !isAccessible && sym.exists then

0 commit comments

Comments
 (0)