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

Skip to first unread message

Adriaan Moors

Feb 9, 2017, 2:02:45 PM2/9/17
to Kevin Oliver (JIRA),
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) <> wrote:
Kevin Oliver commented on Improvement 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 Add Comment
This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)
Atlassian logo
Reply all
Reply to author
0 new messages