Commit a099d7e
committed
Fix issue with macro results having unexpected source switches
Problem seems to have been derived from the fact that we would only
remap the source of the outermost tree inserted in a Hole, instead of
going through the whole tree inserted there. This meant that when
inserting `Block` with `Imports` in the contents, the Block node would
have a new source assigned (causing a source change encoded in the
TASTy), and all contents would still have the previous source assigned
(causing more source changes encoded).
Now we reassign sources to nodes recursively, meaning that only
the outermost node has a source change assigned in TASTy.1 parent 09d64c6 commit a099d7e
File tree
3 files changed
+27
-2
lines changed- compiler/src/dotty/tools/dotc/quoted
- scaladoc-testcases/src/tests/i22265
3 files changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments