Skip to content

Commit 4e10b72

Browse files
committed
More detailed diagnostic in NavigateAST
1 parent 6e70461 commit 4e10b72

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ object NavigateAST {
1717
case (utree: untpd.Tree) :: _ =>
1818
utree
1919
case _ =>
20-
throw new Error(i"no untyped tree for $tree, best matching path =\n${untypedPath(tree, exactMatch = false)}%\n====\n%")
20+
val loosePath = untypedPath(tree, exactMatch = false)
21+
throw new
22+
Error(i"""no untyped tree for $tree, pos = ${tree.pos}, envelope = ${tree.envelope}
23+
|best matching path =\n$loosePath%\n====\n%
24+
|path positions = ${loosePath.map(_.pos)}
25+
|path envelopes = ${loosePath.map(_.envelope)}""".stripMargin)
2126
}
2227

2328
/** The reverse path of untyped trees starting with a tree that closest matches

0 commit comments

Comments
 (0)