Skip to content

Commit b697cfa

Browse files
szymon-rdWojciechMazur
authored andcommitted
Revert "Check if owner of symbol exists"
This reverts commit 2164115. [Cherry-picked c1f4e5a]
1 parent 37ea999 commit b697cfa

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
@@ -669,7 +669,7 @@ object CheckUnused:
669669
val simpleSelections = qual.tpe.member(sym.name).alternatives
670670
val typeSelections = sels.flatMap(n => qual.tpe.member(n.name.toTypeName).alternatives)
671671
val termSelections = sels.flatMap(n => qual.tpe.member(n.name.toTermName).alternatives)
672-
val sameTermPath = qual.isTerm && sym.owner.exists && sym.owner.isType && qual.tpe.typeSymbol == sym.owner.asType
672+
val sameTermPath = qual.isTerm && sym.exists && sym.owner.isType && qual.tpe.typeSymbol == sym.owner.asType
673673
val selectionsToDealias = typeSelections ::: termSelections
674674
def renamedSelection = if(sameTermPath) then sels.find(sel => sel.imported.name == sym.name) else None
675675
val qualHasSymbol = simpleSelections.map(_.symbol).contains(sym) || (simpleSelections ::: selectionsToDealias).map(_.symbol).map(dealias).contains(dealiasedSym) || renamedSelection.isDefined

0 commit comments

Comments
 (0)