Skip to content

Commit

Permalink
Replace lazy val with val
Browse files Browse the repository at this point in the history
[Cherry-picked 6c6070a]
  • Loading branch information
szymon-rd authored and WojciechMazur committed Jun 20, 2024
1 parent f2fc101 commit 71fd92d
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 @@ -671,7 +671,7 @@ object CheckUnused:
val termSelections = sels.flatMap(n => qual.tpe.member(n.name.toTermName).alternatives)
val sameTermPath = qual.isTerm && sym.exists && sym.owner.isType && qual.tpe.typeSymbol == sym.owner.asType
val selectionsToDealias = typeSelections ::: termSelections
lazy val renamedSelection = if sameTermPath then sels.find(sel => sel.imported.name == sym.name) else None
val 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
def selector = sels.find(sel => (sel.name.toTermName == sym.name || sel.name.toTypeName == sym.name) && symName.map(n => n.toTermName == sel.rename).getOrElse(true))
def dealiasedSelector = if(isDerived) sels.flatMap(sel => selectionsToDealias.map(m => (sel, m.symbol))).collect {
Expand Down

0 comments on commit 71fd92d

Please sign in to comment.