Selaed classes cant permit private classes
Olexandr Rotan
rotanolexandr842 at gmail.com
Mon Aug 26 12:28:58 UTC 2024
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/bb949bff/attachment-0001.htm>
More information about the amber-dev
mailing list