And it is quite right that it is not allowed "by d...
# getting-started
d
And it is quite right that it is not allowed "by default":
Copy code
val a: MutableList<String> = mutableListOf()
val b: MutableList<Any> = a // ok, right? I mean String is a subtype of Any, right?
b += Any() // okay,  it's a list of Any, right?
val string: String = a[0] // oops, it's not actually a String