Skip to content

Commit fccb010

Browse files
committed
Fix namedTrees traversal of Inline nodes
Despite what the comment said they were not skipped but traversed in their entirety, which led to "interesting" find-references results. Now only the call is traversed.
1 parent 6569812 commit fccb010

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/interactive/Interactive.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ object Interactive {
166166
(new untpd.TreeTraverser {
167167
override def traverse(tree: untpd.Tree)(implicit ctx: Context) = {
168168
tree match {
169-
case _: untpd.Inlined =>
170-
// Skip inlined trees
171169
case utree: untpd.NameTree if tree.hasType =>
172170
val tree = utree.asInstanceOf[tpd.NameTree]
173171
if (tree.symbol.exists
@@ -177,9 +175,12 @@ object Interactive {
177175
&& (includeReferences || isDefinition(tree))
178176
&& treePredicate(tree))
179177
buf += SourceTree(tree, source)
178+
traverseChildren(tree)
179+
case tree: untpd.Inlined =>
180+
traverse(tree.call)
180181
case _ =>
182+
traverseChildren(tree)
181183
}
182-
traverseChildren(tree)
183184
}
184185
}).traverse(topTree)
185186
}

0 commit comments

Comments
 (0)