Skip to content

Commit

Permalink
Revert "Check if owner of symbol exists"
Browse files Browse the repository at this point in the history
This reverts commit 2164115.
  • Loading branch information
szymon-rd committed Aug 29, 2023
1 parent 2164115 commit c1f4e5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ object CheckUnused:
val simpleSelections = qual.tpe.member(sym.name).alternatives
val typeSelections = sels.flatMap(n => qual.tpe.member(n.name.toTypeName).alternatives)
val termSelections = sels.flatMap(n => qual.tpe.member(n.name.toTermName).alternatives)
val sameTermPath = qual.isTerm && sym.owner.exists && sym.owner.isType && qual.tpe.typeSymbol == sym.owner.asType
val sameTermPath = qual.isTerm && sym.exists && sym.owner.isType && qual.tpe.typeSymbol == sym.owner.asType
val selectionsToDealias = typeSelections ::: termSelections
def renamedSelection = if(sameTermPath) then sels.find(sel => sel.imported.name == sym.name) else None
val qualHasSymbol = simpleSelections.map(_.symbol).contains(sym) || (simpleSelections ::: selectionsToDealias).map(_.symbol).map(dealias).contains(dealiasedSym) || renamedSelection.isDefined
Expand Down

0 comments on commit c1f4e5a

Please sign in to comment.