Commit 32f9deb
committed
Do not create symbols for classfile artifacts
These definitions are not supposed to be called from user code, so
creating symbols for them is unnecessary.
In particular, this fixes various issues with bridges:
- Fix #6152: We require `override` to implement bridged abstract method
- Fix #8435: Generic signature is missing for bridged method
(This PR is only possible thanks to #8499, without this we would use
non-bridge symbols as receivers and get IllegalAccessErrors in various
cases).
Note that this is slightly different from what Scala 2 does:
`Type#member` in scalac excludes symbols with the Bridge flag set by
default, we can't copy that behavior without more changes on our end
since member filtering works differently in both compiler: in Scala 2 if
a symbol with an excluded flag overrides a symbol without the flag, the
overridden symbol is returned, whereas no symbol is returned in Dotty.
In any case, I think that simply not creating the symbols is a more
systematic solution, it also makes separate compilation of .java and
.scala files work more like joint compilation since under joint
compilation we never see the synthetic members generated by javac
anyway, this reduces the risk of bugs which appear only under one
kind of compilation and not the other.1 parent 6d1f095 commit 32f9deb
File tree
6 files changed
+21
-1
lines changed- compiler/src/dotty/tools/dotc/core
- classfile
- tests/pos-java-interop-separate
- i6152
- i8435
6 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments