In cases when utilizing types such as `interface F...
# announcements
h
In cases when utilizing types such as
interface Foo<F: Foo<F>>
I'm always confused by when I can define a type as
Copy code
interface Foo<F: Foo<F>> {
    val incorrect: F // why can I almost never define it like this?
    val correct: Foo<F> // why does the type require Foo<F>, when F is already Foo<F>?
}
s
Not sure. Your code snippet compiles fine
Copy code
interface Foo<F: Foo<F>> {
    val incorrect: F // why can I almost never define it like this?
    val correct: Foo<F> // why does the type require Foo<F>, when F is already Foo<F>?
}

class FooImpl: Foo<FooImpl> {
    override val incorrect: FooImpl get() = TODO("not implemented")
    override val correct: Foo<FooImpl> get() = TODO("not implemented")
}