From 37aaa153c5155208731f717d951757238598cd76 Mon Sep 17 00:00:00 2001 From: Martin Duhem Date: Tue, 9 Oct 2018 14:20:13 +0200 Subject: [PATCH] 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`. --- compiler/src/dotty/tools/dotc/interactive/Interactive.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala index 74bd3d86c3bc..46b8369c04b5 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala @@ -321,8 +321,7 @@ object Interactive { val includeDeclaration = (includes & Include.definitions) != 0 val includeLinkedClass = (includes & Include.linkedClass) != 0 val predicate: NameTree => Boolean = tree => - ( tree.pos.isSourceDerived - && !tree.symbol.isPrimaryConstructor + ( !tree.symbol.isPrimaryConstructor && (includeDeclaration || !Interactive.isDefinition(tree)) && ( Interactive.matchSymbol(tree, symbol, includes) || ( includeDeclaration