Selaed classes cant permit private classes

Jan Lahoda jan.lahoda at oracle.com
Mon Aug 26 13:42:51 UTC 2024


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 Tmppermits Tmp.A {
>      
>      private static final class Aextends 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/1094b2d0/attachment.htm>


More information about the amber-dev mailing list