I have this situation: There are a Java class
public class A {
public void overrideMe(B param){
//TODO: override me in Kotlin!
}
protected static class B {
}
}
and a Kotlin class, which inherits from it and has to override method "overrideMe"
class K: A() {
override fun overrideMe(param: B) {
println("Wow!")
}
}
But Kotlin doesn't allow this behaviour.
'public' function exposes its 'protected (in A)' parameter type B
Is there any way how to resolve this one?
P.S. It's not just a synthetic case - I faced this problem when I tried to implement custom Spring AmqpAppender and to override it's postProcessMessageBeforeSend method.
Well, after all, the conclusion is: there is no way to solve this situation in pure Kotlin.
I hope that AmqpAppender.Event will become public in the nearest future.
Even if Java allows that behaviour, having no-public arguments in public methods seems like a bad design for me (also for the developers of Kotlin).