shouldn't smart cast cover this case ? ``` fun mai...
# announcements
s
shouldn't smart cast cover this case ?
Copy code
fun main(args: Array<String>) {
	listOf("5","12","-10","bar","").map { 
        val foo = it.toIntOrNull()
            when(foo) {
                in 0..10 -> {
                    //foo is not smart cast'ed, it has to be an Int at this point
                    val x = 100 + foo
                    println("shouldn't this be smart casted?")
                }
                else -> {
                    println("$foo : nope")
                } 
            }
    }
}