>Kotlin protects you from mistakenly operating ...
# announcements
k
Kotlin protects you from mistakenly operating on nullable types
Copy code
fun foo(): String {
    null?.let {
        return it
    }
}

println(foo().length) //NullPointerException
r
That's a pretty serious regression. Make sure you report it.
k
Yup doing that right now.
👍 2
That took a while, I clicked "Clear Draft" twice.
Why does that button look so much like submit!
p
Nice catch @karelpeeters! In the issue description you wrote
safe index operator
. Did you mean safe call operator?
k
Ah then I've been using the wrong name for a while, thanks!
👍 1
Huh that's funny, I thought the
.
-operator was called "the index operator", but I can't find references to that anywhere.
r
@karelpeeters I believe it's just called the dot operator.
k
Yeah I think it comes from some dynamically typed languages where the dot literally indexes.