Commit d94b08a
committed
sourcepath: fix handling of top-level definitions
5c2a2d5 was a bit too clever: instead
of running the desugaring of top-level definitions, it manually checked
if such a desugaring was needed and then entered the package object if
needed and traversed the non-desugared package statements, but in a
situation like this:
package foo
type Foo
object Foo
The desugaring will move `object Foo` inside the package object,
so by traversing the non-desugared tree, we were creating a symbol
for Foo at the wrong level.
This commit fixes this by simply calling the appropriate desugaring
method before doing any traversal. Unfortunately I wasn't able to
manufacture a testcase where this makes a difference, but this
fixes some issues I saw when compiling dotty-library itself.1 parent 0a33ad3 commit d94b08a
File tree
2 files changed
+9
-10
lines changed- compiler/src/dotty/tools/dotc
- ast
- core
2 files changed
+9
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | 1232 | | |
1239 | 1233 | | |
1240 | 1234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
141 | | - | |
142 | | - | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
0 commit comments