https://kotlinlang.org logo
Title
k

karelpeeters

11/07/2018, 8:05 PM
Kotlin protects you from mistakenly operating on nullable types
fun foo(): String {
    null?.let {
        return it
    }
}

println(foo().length) //NullPointerException
r

Ruckus

11/07/2018, 8:11 PM
That's a pretty serious regression. Make sure you report it.
k

karelpeeters

11/07/2018, 8:11 PM
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

Pavlo Liapota

11/07/2018, 8:29 PM
Nice catch @karelpeeters! In the issue description you wrote
safe index operator
. Did you mean safe call operator?
k

karelpeeters

11/07/2018, 8:30 PM
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

Ruckus

11/07/2018, 10:37 PM
@karelpeeters I believe it's just called the dot operator.
k

karelpeeters

11/07/2018, 10:40 PM
Yeah I think it comes from some dynamically typed languages where the dot literally indexes.