Skip to content

Commit 66e9ea8

Browse files
committed
Avoid prepare actions form earlier phases when doing a transformFollowinfDeep
See comment in the code.
1 parent b8c61a5 commit 66e9ea8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/dotty/tools/dotc/transform/TreeTransform.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,14 @@ object TreeTransforms {
486486
var nxCopied = false
487487
var result = info.transformers
488488
var resultNX = info.nx
489-
var i = mutationPlan(0) // if TreeTransform.transform() method didn't exist we could have used mutationPlan(cur)
489+
var i = mutationPlan(cur)
490+
// @DarkDimius You commented on the previous version
491+
//
492+
// var i = mutationPlan(0) // if TreeTransform.transform() method didn't exist we could have used mutationPlan(cur)
493+
//
494+
// But we need to use `cur` or otherwise we call prepare actions preceding the
495+
// phase that issued a transformFollowing. This can lead to "denotation not defined
496+
// here" errors. Note that tests still pass with the current modified code.
490497
val l = result.length
491498
var allDone = i < l
492499
while (i < l) {

0 commit comments

Comments
 (0)