File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ package ast
4
4
import core .Contexts .Context
5
5
import core .Decorators ._
6
6
import util .Positions ._
7
- import Trees .{MemberDef , DefTree }
7
+ import Trees .{MemberDef , DefTree , WithLazyField }
8
8
9
9
/** Utility functions to go from typed to untyped ASTs */
10
10
object NavigateAST {
@@ -75,8 +75,17 @@ object NavigateAST {
75
75
path
76
76
}
77
77
def singlePath (p : Positioned , path : List [Positioned ]): List [Positioned ] =
78
- if (p.pos contains pos) childPath(p.productIterator, p :: path)
79
- else path
78
+ if (p.pos contains pos) {
79
+ // FIXME: We shouldn't be manually forcing trees here, we should replace
80
+ // our usage of `productIterator` by something in `Positioned` that takes
81
+ // care of low-level details like this for us.
82
+ p match {
83
+ case p : WithLazyField [_] =>
84
+ p.forceIfLazy
85
+ case _ =>
86
+ }
87
+ childPath(p.productIterator, p :: path)
88
+ } else path
80
89
singlePath(from, Nil )
81
90
}
82
- }
91
+ }
You can’t perform that action at this time.
0 commit comments