Skip to content

Commit 0ee03ef

Browse files
committed
Filter findDefinitions, to avoid using the wrong one
Tested by giving exportTerm0 and exportTerm1 difference filenames, resulting in different locations and breakage.
1 parent 2a02773 commit 0ee03ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

presentation-compiler/src/main/dotty/tools/pc/PcDefinitionProvider.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class PcDefinitionProvider(
124124
val isLocal = sym.source == pos.source
125125
if isLocal then
126126
val defs =
127-
Interactive.findDefinitions(List(sym), driver, false, false)
127+
Interactive.findDefinitions(List(sym), driver, false, false).filter(_.source == sym.source)
128128
defs.headOption match
129129
case Some(srcTree) =>
130130
val pos = srcTree.namePos

0 commit comments

Comments
 (0)