I recently study about kotlin Generics, But i found some weird stituation
interface MyItem
fun <ITEM : MyItem> bindItem(items: List<ITEM>?) {
val castedItem = items as List<MyItem>?
}
fun <ITEM : MyItem> bindItem2(items: MutableList<ITEM>?) {
val castedItem = items as MutableList<MyItem>?
}
Only In MutableList case compiler warn about unchecked Cast
If anyone knows about this situation, Please tell me about this.