Skip to content

Commit bc499ee

Browse files
committed
docs: Add a comment to pathTo mentioning that it might return errorTermTree
1 parent 9614fb9 commit bc499ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ object Interactive {
247247
/** The reverse path to the node that closest encloses position `pos`,
248248
* or `Nil` if no such path exists. If a non-empty path is returned it starts with
249249
* the tree closest enclosing `pos` and ends with an element of `trees`.
250+
*
251+
* Note that if the given `pos` points out places for incomplete parses,
252+
* this method returns `errorTermTree` (`Literal(Consotant(null)`).
253+
*
254+
* @see https://github.com/lampepfl/dotty/issues/15294
250255
*/
251256
def pathTo(trees: List[SourceTree], pos: SourcePosition)(using Context): List[Tree] =
252257
pathTo(trees.map(_.tree), pos.span)

0 commit comments

Comments
 (0)