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
support for JVM's visibility modifiers #10174
Comments
Imported From: https://issues.scala-lang.org/browse/SI-10174?orig=1 |
@adriaanm said: The problem in compiling visibility to bytecode modifiers when qualifying visibility with a package lies with our notion of package nesting, whereas Java does not consider packages package a { private[a] class A }
// [fastforward ten years] you add:
package a.sub { private[a] class B extends a.A } // compiles To be honest, we've kind of been hoping Java 9's module system would take care of this for us, but I would love to fix this if we can find a reasonable way. |
Jasper-M said: |
Kevin Oliver (kevinoliver) said:
Yep, I totally get that. And I think that is why Scala can't simply translate
Agreed, I believe it orthogonal to default visibility. My annotation proposal was crafted in the interest of backwards compatibility. As mentioned above, I have zero attachment to it being done this specific way. Perhaps I should have filed these as separate tickets, but I didn't know enough about the compiler to have a good sense. |
@adriaanm said (edited on Feb 9, 2017 10:47:57 PM UTC):
There's no easy comprehensive fix, but maybe there'll be a good pragmatic compromise. Perhaps using an annotation on the qualifier, such as (the strawman: ) |
While Finagle is primarily written in Scala, we support Java users as well. The lack of byte code support for JVM's protected visibility and default (package) visibility is limiting.
We'd love support for these, perhaps via an annotation. A sketch of what it might look like:
The text was updated successfully, but these errors were encountered: