Re: [scala-bts] (SI-10174) support for JVM's visibility modifiers

Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: [scala-bts] (SI-10174) support for JVM's visibility modifiers

Adriaan Moors-7
Thanks for clarifying. I'll keep mulling this over. Agreed that any pragmatic solution is better than status quo.
On Wed, Feb 8, 2017 at 13:58 Kevin Oliver (JIRA) <[hidden email]> wrote:
Kevin Oliver commented on SI-10174
Re: support for JVM's visibility modifiers

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 `` and `` related in any way.

Yep, I totally get that. And I think that is why Scala can't simply translate private[a] into default visibility. Thus my annotation proposal. If there is another keyword or way this can be indicated to Scalac, that'd be great. I'm not at all tied to using annotations. It was intended to be illustrative.

As for protected, aren't protected and protected[this] in scala at least as strict as protected in java?
So in those cases it would be possible to emit a protected modifier?

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.

Add Comment
This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)

You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit

15a2440ecbe01 (1K) Download Attachment
15a2440ecbe02 (1K) Download Attachment
15a2440ecbe03 (4K) Download Attachment
15a2440ecbe04 (3K) Download Attachment
(1K) Download Attachment