> it doesn’t work because it wouldn’t work in J...
# getting-started
m
it doesn’t work because it wouldn’t work in Java too
Kotlin is being compiled to JVM-bytecode, not to Java. There’s no nested and/or inner classes at the bytecode level, so there’s no technical restriction to do this. The question is, would nested class have the only one companion object instance, or a companion per outer class? And there’s no such question with this restriction.