Commit fbea0ff
committed
Parse empty Java compilation units as EmptyTree
Before this commit, an empty Java compilation unit (one without a
package declaration or any top level declarations) was parsed as
`PackageDef(Ident(<empty>),List())` which resulted in position not set errors.
With this commit, an empty Java compilation unit is parsed as `EmptyTree`.
This is consistent with the parsing of empty Scala compilation units.
Fixes #133101 parent 8bb0ca7 commit fbea0ff
File tree
2 files changed
+5
-1
lines changed- compiler/src/dotty/tools/dotc/parsing
- tests/pos
2 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
1016 | | - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1017 | 1019 | | |
1018 | 1020 | | |
1019 | 1021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments