Skip to content

docs: Add a comment to pathTo mentioning that it might return errorTermTree #15420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/src/dotty/tools/dotc/interactive/Interactive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ object Interactive {
/** The reverse path to the node that closest encloses position `pos`,
* or `Nil` if no such path exists. If a non-empty path is returned it starts with
* the tree closest enclosing `pos` and ends with an element of `trees`.
*
* Note that if the given `pos` points out places for incomplete parses,
* this method returns `errorTermTree` (`Literal(Consotant(null)`).
*
* @see https://github.com/lampepfl/dotty/issues/15294
*/
def pathTo(trees: List[SourceTree], pos: SourcePosition)(using Context): List[Tree] =
pathTo(trees.map(_.tree), pos.span)
Expand Down