Skip to content

Commit f8f98cc

Browse files
dwijnandWojciechMazur
authored andcommitted
Filter findDefinitions, to avoid using the wrong one
Tested by giving exportTerm0 and exportTerm1 difference filenames, resulting in different locations and breakage. [Cherry-picked 0ee03ef]
1 parent fe6b1b4 commit f8f98cc

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

Lines changed: 1 addition & 1 deletion
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)