janvladimirmostert
09/27/2017, 11:17 AMb?.let
still won't compile since in theory you can do:
var b: Int? = null
listOf("a", "b", "c").forEach {
b?.let {
println(b + 1) <--- compiler error here unless you use `!!` or `b as Int`
}
thread {
b = null
}
}
Even when you don't have a thread modifying the value of b
, the compiler will still complain Smart cast to Int is impossible, ...