pniederw
09/14/2017, 9:33 AMclass Outer {
sealed class Foo {}
// cannot access '<init>': it is private in 'Foo'
class Bar : Foo() {}
}
orangy
09/14/2017, 9:35 AMnil2l
09/14/2017, 9:39 AMA sealed class can have subclasses, but all of them must be declared in the same file as the sealed class itself. (Before Kotlin 1.1, the rules were even more strict: classes had to be nested inside the declaration of the sealed class).
pniederw
09/14/2017, 9:40 AMnil2l
09/14/2017, 9:41 AMpniederw
09/14/2017, 9:41 AMnil2l
09/14/2017, 9:43 AMall of them _must_ be declared in the same file as the sealed class itself
pniederw
09/14/2017, 9:43 AMstanislav.erokhin
09/14/2017, 9:44 AM