Skip to content

Commit 37aaa15

Browse files
committed
Don't check positions in findTreesMatching
We used to check the positions in `findTreesMatching` and exclude trees where the position is not source-derived. It turns out that this is wrong, because this will exclude all trees that have been unpickled. The correct test, checking whether the position has a zero extent, is already done in `namedTrees`.
1 parent f693e04 commit 37aaa15

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ object Interactive {
321321
val includeDeclaration = (includes & Include.definitions) != 0
322322
val includeLinkedClass = (includes & Include.linkedClass) != 0
323323
val predicate: NameTree => Boolean = tree =>
324-
( tree.pos.isSourceDerived
325-
&& !tree.symbol.isPrimaryConstructor
324+
( !tree.symbol.isPrimaryConstructor
326325
&& (includeDeclaration || !Interactive.isDefinition(tree))
327326
&& ( Interactive.matchSymbol(tree, symbol, includes)
328327
|| ( includeDeclaration

0 commit comments

Comments
 (0)