File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ object NavigateAST {
7777 var bestFit : List [Positioned ] = path
7878 while (it.hasNext) do
7979 val path1 = it.next() match
80- case sel : untpd.Select if isTreeFromRecovery(sel) => path
80+ case sel : untpd.Select if isRecoveryTree(sel) => path
81+ case sel : untpd.Ident if isPatternRecoveryTree(sel) => path
8182 case p : Positioned if ! p.isInstanceOf [Closure [? ]] => singlePath(p, path)
8283 case m : untpd.Modifiers => childPath(m.productIterator, path)
8384 case xs : List [? ] => childPath(xs.iterator, path)
@@ -106,9 +107,12 @@ object NavigateAST {
106107 bestSpan.contains(candidateSpan) && bestSpan.isSynthetic && ! candidateSpan.isSynthetic
107108 else false
108109
110+ def isRecoveryTree (sel : untpd.Select ): Boolean =
111+ sel.span.isSynthetic
112+ && (sel.name == StdNames .nme.??? && sel.qualifier.symbol.name == StdNames .nme.Predef )
109113
110- def isTreeFromRecovery ( p : untpd.Select ): Boolean =
111- p.name == StdNames .nme. ??? && p.qualifier.symbol.name == StdNames .nme. Predef && p.span.isSynthetic
114+ def isPatternRecoveryTree ( ident : untpd.Ident ): Boolean =
115+ ident.span.isSynthetic && StdNames .nme. WILDCARD == ident.name
112116
113117 def envelops (a : Span , b : Span ): Boolean =
114118 ! b.exists || a.exists && (
You can’t perform that action at this time.
0 commit comments