silas.schwarz
06/14/2018, 11:33 AMfun 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")
}
}
}
}