Skip to content

3.6.4/issue/22692 unused import #22710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,10 @@ object CheckUnused:
else
selData.allSymbolsForNamed.contains(sym)
else
if altName.exists(alt => alt.toTermName != sym.name.toTermName) then // rename is never a wildcard import
false
// Wildcard
if selData.excludedMembers.contains(altName.getOrElse(sym.name).toTermName) then
else if selData.excludedMembers.contains(altName.getOrElse(sym.name).toTermName) then
// Wildcard with exclusions that match the symbol
false
else if !selData.qualTpe.member(sym.name).hasAltWith(_.symbol == sym) then
Expand Down
8 changes: 8 additions & 0 deletions tests/warn/i22692.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

//> using options -Wunused:all

import javax.swing.*
import javax.swing.event as swingEvent

type b = AbstractButton
type t = swingEvent.AncestorListener
Loading