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
separate accessibility and lifting #7085
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7085?orig=1 |
@retronym said:
Could you elaborate on that point? I thought that any method can be called from a different compilation unit affect BC. So the specific case of |
@adriaanm said: |
@retronym said:
If we compiled In addition, we would need to generate stable names for the accessors (rather than java's So perhaps we need to consider the scheme used for package-qualified access separately from other cases. Another tricky aspect of Java's approach to access is constructors. It creates 'access constructors' with an extra dummy parameter. The type of the parameter was used to uniquely distinguish the constructors, and was chosen to be the type of the inner class that needed to access the constructor. |
Guillaume Martres (Smarter) said: |
@retronym said: |
when java needs to give access to an inaccessible method, it doesn't change the method itself, but generates a synthetic static accessor that takes the same arguments, plus the this pointer for that method
this scheme makes it easier to stay binary compatible in the presence of changing access patterns, because it doesn't involve making private, non-synthetic, methods public when the need arises for them to be accessible from somewhere
as the static accessor is synthetic, it doesn't affect binary compatibility
This might give us a chance at fixing:
which, as reported in #6387 (now marked as a duplicate), gives an
AbstractMethodError
The text was updated successfully, but these errors were encountered: