fun calc(x: List?, y: Int?) { // Smart cast should work here despite of KT-7204 fixed x?.subList(0, y!!)?.get(y) }