Kotlin allows to do that but uses different default behavior.
Inner class in Kotlin by default behave like Java’s class with static
modifier on inner class. So it’s completely separate class without reference to the parent.
If you want to get access to parent class like in java without static
you should add modifier inner
to Kotlin’s internal class.
It just forces you to be more explicit for such case and it’s harder to leak parent class accidentally like in java, when you just forgot to mark inner class static, it’s actually not the best practice in most cases