<div dir="ltr">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):<div><br></div><div><pre style="color:rgb(188,190,196);font-family:"JetBrains Mono",monospace"><span style="color:rgb(207,142,109)">sealed class </span>Tmp <span style="color:rgb(207,142,109)">permits </span>Tmp.A {<br>    <br>    <span style="color:rgb(207,142,109)">private static final class </span>A <span style="color:rgb(207,142,109)">extends </span>Tmp {<br>    }<br>}</pre><pre style="color:rgb(188,190,196);font-family:"JetBrains Mono",monospace"><br></pre><pre style=""><span style="background-color:rgb(243,243,243)"><font color="#000000" style="" face="arial, sans-serif">I got following error:</font></span></pre><pre style="">error: A has private access in Tmp</pre><pre style=""><br></pre><pre style=""><font face="arial, sans-serif">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?</font></pre><pre style=""><span style="background-color:rgb(243,243,243)">
</span></pre></div></div>