frellan
06/10/2018, 10:06 PMfor (i in 0 until listA.size) {
if (listB[i] == null || listC[i] == null) continue
val b = listB[i]
val c = listC[i]
}
In the above example, neither b
nor c
is smart casted to a non null variable. I am forced to do this:
for (i in 0 until listA.size) {
if (listB[i] == null || listC[i] == null) continue
val b = listB[i]!!
val c = listC[i]!!
}
Am I doing something wrong? Anybody encountered issues with smart cast and continue
?gildor
06/11/2018, 3:24 AMlistB[i]
to local variables and check them for null and in this case smart cast will work for your