-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Generate static inline accessors in the outermost scope #16796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cca0bf7
to
146b347
Compare
This ticket for this bug raised questions about binary compatibility. Is this fix actually compatible? |
d3f782e
to
f25bec2
Compare
Yes, there are some issues with binary compatibility in this first implementation. I plan to generate the old (sometimes buggy) accessors for backward compatibility but not use them in the new code. I first need to create a set of representative cross-compilation tests. This PR should not be merged if I do not manage to keep the binary compatibility. |
6fbd4cf
to
85318d8
Compare
d17088d
to
eb918a6
Compare
Only inline accessors can add accessors to static members defined outside their top-level class. These get the package owning the top-level class from `hostForAccessorOf`.
eb918a6
to
ec9d062
Compare
If a class `C` needs inline accessors that would be added top-level or if the accessor is to a static member, we place it in a new invisible module `C$inline$accessors`. If the accessor location in the new scheme is not the same as the previous location, we also generate the old accessor for backward binary compatibility but do not use it. Fixes scala#13215 Fixes scala#15413
ec9d062
to
f4e4bb0
Compare
Replaced with #16992 |
If a class
C
needs inline accessors that would be added top-level or if the accessor is to a static member, we place it in a new invisible moduleC$inline$accessors
.If the accessor location in the new scheme is not the same as the previous location, we also generate the old accessor for backward binary compatibility but do not use it.
Fixes #13215
Fixes #15413
Example
becomes