https://kotlinlang.org logo
Title
j

JoaoGoulart

03/29/2019, 12:31 PM
Hey guys. So, i Have a abstract class in Java that has a abstract method like this:
public abstract class MyClass implements MyInterface {
    @Override
    public abstract <M extends MyInterface> MyModelType<M> getModelType();
}
How do i implement this in Kolin? i always get this:
override fun <M : MyInterface?> getModelType(): MyModelType<M> {
        TODO
    }
but this is not what i want, in Java works fine
@Override
    public MyModelType<MyClassImpl> getModelType() {
        return null;
    }
Any ideas on how to do it?
r

ribesg

03/29/2019, 12:41 PM
Your Java override snippet does not seem to match the abstract function, while your kotlin snippet does.
<M extends MyInterface>
and
<MyClassImpl>
are not the same thing.