Selaed classes cant permit private classes
Olexandr Rotan
rotanolexandr842 at gmail.com
Mon Aug 26 13:44:27 UTC 2024
Hi Jan, thank you very much. I`ll look into the issue later today
On Mon, Aug 26, 2024 at 4:43 PM Jan Lahoda <jan.lahoda at oracle.com> wrote:
> Hi Olexandr,
>
>
> Thanks for the report. I've filled:
> https://bugs.openjdk.org/browse/JDK-8338981
>
>
> Jan
>
>
> On 26. 08. 24 14:28, Olexandr Rotan wrote:
>
> Hello. Recently, I have started a new project to explore Babylon code
> reflection API (LInq), and thought that using sealed classes to represent
> operand type would be really suitable (function calls, column refs etc.).
> However, I want to only expose one interface/abstract class for each of
> those types, while actual implementations are private classes inside sealed
> classes. However, when I tried to compile something like this (simplified
> for brevity):
>
> sealed class Tmp permits Tmp.A {
>
> private static final class A extends Tmp {
> }
> }
>
> I got following error:
>
> error: A has private access in Tmp
>
> Is this behaviour expected or not?
> (I would assume second since intellij code analysis didn't mark this as error)
>
> If it's later, I would ask some JDK member to file a bug report (I noticed that they
> are processed faster then non-member requests), and I will try to fix this. If it`s
> premier, then what is the motivation behind this?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20240826/c2eb338b/attachment.htm>
More information about the amber-dev
mailing list