Say I have this code in Java: ``` interface Foo&l...
# announcements
a
Say I have this code in Java:
Copy code
interface Foo<T> {}

class JavaStringFoo implements Foo<String> {}

class JavaStringListFoo implements Foo<List<String>> {}

class Spam {
    Foo<String> one() {
        return new JavaStringFoo();
    }

    Foo<String> two() {
        return new KotlinStringFoo();
    }

    Foo<List<String>> three() {
        return new JavaStringListFoo();
    }

    Foo<List<String>> four() {
        return new KotlinStringListFoo();
    }
}
and this code in Kotlin:
Copy code
class KotlinStringFoo : Foo<String>

class KotlinStringListFoo : Foo<List<String>>
I’d think
KotlinStringFoo
code is equivalent to
JavaStringFoo
and
KotlinStringListFoo
to
JavaStringListFoo
. But I get this error in `four()`:
incompatible types: KotlinStringListFoo cannot be converted to Foo<List<String>>
This is while other three functions compile just fine. What’s up with that? How do I fix it?