From 4db804bc7b75038a8b4a36d4132af21e30c15ebc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 8 Mar 2016 18:05:41 +0100 Subject: More detailed diagnostic in NavigateAST --- src/dotty/tools/dotc/ast/NavigateAST.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/ast/NavigateAST.scala b/src/dotty/tools/dotc/ast/NavigateAST.scala index 9c1c17f50..3753c6702 100644 --- a/src/dotty/tools/dotc/ast/NavigateAST.scala +++ b/src/dotty/tools/dotc/ast/NavigateAST.scala @@ -17,7 +17,12 @@ object NavigateAST { case (utree: untpd.Tree) :: _ => utree case _ => - throw new Error(i"no untyped tree for $tree, best matching path =\n${untypedPath(tree, exactMatch = false)}%\n====\n%") + val loosePath = untypedPath(tree, exactMatch = false) + throw new + Error(i"""no untyped tree for $tree, pos = ${tree.pos}, envelope = ${tree.envelope} + |best matching path =\n$loosePath%\n====\n% + |path positions = ${loosePath.map(_.pos)} + |path envelopes = ${loosePath.map(_.envelope)}""".stripMargin) } /** The reverse path of untyped trees starting with a tree that closest matches -- cgit v1.2.3