Skip to content

Commit 944c08b

Browse files
committed
Tweak NavigateAST.toPath
1 parent 5178072 commit 944c08b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/ast/NavigateAST.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ object NavigateAST {
7979
case _ => path
8080
}
8181
if ((path1 ne path) &&
82-
((bestFit eq path) || bestFit.head.span.contains(path1.head.span)))
82+
((bestFit eq path) ||
83+
bestFit.head.span != path1.head.span &&
84+
bestFit.head.span.contains(path1.head.span)))
8385
bestFit = path1
8486
}
8587
bestFit

0 commit comments

Comments
 (0)