apatrida
03/02/2016, 1:20 PMAbstractMethodError
. So how do you work around this:
Interface Base
with method init()
in Java. Kotlin extends this with interface MyBase
and adds a default implementation of init()
. That is extended into MyMegaBase
interface which does more. Then finally HappyConcreteClass
class implements those and has a base class but does not override the default method. So a call that basically says the following, results in an `AbstractMethodError`:
if (instance instanceof Base) {
((Base)instance).init();
}
The default method should be generated into MyMegaBase
as the first class that implements the interface, yes? So why the error. (reported as https://youtrack.jetbrains.com/issue/KT-11267, but maybe isn’t a bug, it is just not allowed)