interface A {
var a: Int
}
class AJunior : A {
override var a: Int
init {
a = 3
}
}
It will not compile because
Property must be initialized or abstract.
But it is initialized. I know I can write:
override var a: Int = 3
But why doesn't the first example compile? I assume this is a bug or an intentional limitation to simplify the implementation of the compiler, but I'm not sure.
source
share