i filed a suggestion for Smart Cast, anybody got t...
# language-proposals
e
i filed a suggestion for Smart Cast, anybody got thoughts or feedback? https://youtrack.jetbrains.com/issue/KT-18023
😱 1
👎 7
b
This is what
bar.let
is for
e
yeah, just can’t combine with multiple null checks or other boolean logic 😭
and last i checked, doesn’t let you do an else block, right?
b
And for that you save it to a local variable
😉 1
😱 1
k
foo?.let { print("$foo") } ?: run { print("foo was null!") }
👍 1
this is very implicit and very magical, I would not want this feature
☝️ 2
a
Not my favorite feature, you can write extension functions or use
let
as mentioned above to do the same without so much work. Kotlin language needs to resist growing out of every small idea, and make sure that we analyze behavior of Kotlin programmers over a long period of time to whittle out idiosyncrasies of individuals in favor of the common good.
👏 6