Like this: <https://kotlinlang.org/docs/reference/...
# getting-started
k
c
Doesn't talk about this 😞 Java has this in some way I think
k
I meant to link to the last paragraph on that page, looks like the chapter links are broken.
"Type Projections"
c
Reread it, but the thing is I want to have a T that implements multiple things on the go just as I declare it as a parametr. I usually figure out to put `<out T>`'s when I have to cast some implementation
k
Can you perhaps give us a simple Java example?
c
Copy code
interface A {
}
interface B {
}
class C<T extends A & B> {
    private final T value;
    public C(T implementation) {
        value = implementation;
    }
    public A getA() {
        return value;
    }
    public B getB() {
        return value;
    }
}
No compiler warnings for this in java
k
Works fine for me:
Copy code
interface A
interface B

class C<T>(val value: T) where T: A, T: B {
	val valueA: A = value
	val valueB: B = value
}
c
oh cheers, wasn't aware of
where
after constructor declaration
🙂 1