hello, i tried to extend a sealed class nested ins...
# announcements
j
hello, i tried to extend a sealed class nested inside an object declaration without nesting the subclass under the superclass, which results in a compilation error. i’m using 1.3 and as per the documentation the above should be legal since 1.1. is this a bug?
k
What documentation above, what code and what error message?
j
“above” was in reference to the scenario described. for the code, see this paste: https://pastebin.com/uhrBsXTt and note that the same declarations outside of the object compile without error. the error reads: “this type is sealed, so it can be inherited by only its own nested classes or objects”, also “cannot access '<init>': it is private in 'A'”
k
j
is this the same issue though?
for me the linked issue seems like a different one, even the poster notes that the error message is misleading
k
It's also about sealed classes declared within other classes, doesn't matter if they are objects. The first example in the comments on that issue is pretty much exactly your case.
j
i see, thanks