If I decompile the .class file generated by data class State(val b: List<Array<Int>>) then I get the following Java code:
public final class State {
private final List<? extends Integer[]> b;
public State(List<? extends Integer[]> b) {
this.b = b;
}
public final List<Integer[]> getB() {
return this.b;
}
// ...
}
If I copy/paste this java code into my IDE (Intellij 15), I get the following compilation error in the getB() method:
Incompatible types.
Required: List<Integer[]>
Found: List<? extends Integer[]>
What am I missing here? How is the Kotlin generated code able to do this but not my copy/pasted version?