I have a public sealed class with a protected constructor that takes an internal class as a parameter, and IntelliJ doesn’t like it. Is this a bug?
internal class Foo public sealed class Bar protected constructor(foo: Foo) <-- error
Unless I’m misunderstanding something about sealed classes and internal classes, I think this should be fine. The class is public, but it is sealed, so it cannot be extended outside of my module. The primary constructor is protected, so it can only be called by subtypes of this class, and since the class is sealed, the only subtypes would have to be within my module. Ergo, this primary constructor can only be called from within my module, therefore using internal classes as parameters to this primary constructor should be fine, right?
Am I missing something, or is this a bug?