I have a class in java that accepts a generic type that extends another class How can I extend the first class in Kotlin?
I've already tried using out keyword but it's no good.
EntityFragment.java
public abstract class EntityFragment<T extends EntityModule> extends BaseFragment {
public EntityFragment(T module, boolean root) {
        //some code
}
My kotlin class that I'm trying to write is as below:
open class WidthChangeNotifierFragment<out T : EntityStorage>(t: T, root: Boolean) : EntityFragment<T>(t, root) {
You shouldn't use out keyword in this case. You can just write 
open class WidthChangeNotifierFragment<T : EntityModule>(t: T, root: Boolean) : EntityFragment<T>(t, root)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With