File tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/ast
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ object NavigateAST {
77
77
var bestFit : List [Positioned ] = path
78
78
while (it.hasNext) do
79
79
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
81
82
case p : Positioned if ! p.isInstanceOf [Closure [? ]] => singlePath(p, path)
82
83
case m : untpd.Modifiers => childPath(m.productIterator, path)
83
84
case xs : List [? ] => childPath(xs.iterator, path)
@@ -106,9 +107,12 @@ object NavigateAST {
106
107
bestSpan.contains(candidateSpan) && bestSpan.isSynthetic && ! candidateSpan.isSynthetic
107
108
else false
108
109
110
+ def isRecoveryTree (sel : untpd.Select ): Boolean =
111
+ sel.span.isSynthetic
112
+ && (sel.name == StdNames .nme.??? && sel.qualifier.symbol.name == StdNames .nme.Predef )
109
113
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
112
116
113
117
def envelops (a : Span , b : Span ): Boolean =
114
118
! b.exists || a.exists && (
You can’t perform that action at this time.
0 commit comments