Skip to content

Commit 08fc927

Browse files
Backport "Lint avoids revisiting Inlined.call" to 3.7.4 (#24283)
Backports #24277 to the 3.7.4. PR submitted by the release tooling. [skip ci]
2 parents b4e531e + 30127f0 commit 08fc927

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ class CheckUnused private (phaseMode: PhaseMode, suffix: String) extends MiniPha
141141
tree
142142

143143
override def transformInlined(tree: Inlined)(using Context): tree.type =
144-
transformAllDeep(tree.call)
144+
if !tree.call.isEmpty then
145+
if !refInfos.calls.containsKey(tree.call) then
146+
refInfos.calls.put(tree.call, ())
147+
transformAllDeep(tree.call)
145148
tree
146149

147150
override def prepareForBind(tree: Bind)(using Context): Context =
@@ -425,6 +428,7 @@ object CheckUnused:
425428
val asss = mutable.Set.empty[Symbol] // targets of assignment
426429
val skip = mutable.Set.empty[Symbol] // methods to skip (don't warn about their params)
427430
val nowarn = mutable.Set.empty[Symbol] // marked @nowarn
431+
val calls = new IdentityHashMap[Tree, Unit] // inlined call already seen
428432
val imps = new IdentityHashMap[Import, Unit] // imports
429433
val sels = new IdentityHashMap[ImportSelector, Unit] // matched selectors
430434
def register(tree: Tree)(using Context): Unit = if tree.srcPos.isUserCode then

0 commit comments

Comments
 (0)