if requirementsAndInfo.key is nullable, that check...
# getting-started
o
if requirementsAndInfo.key is nullable, that check inside the if is not sufficient to convince the parser that I did in fact check for nullability
a
Is it
var
?
o
no in this case it’s val
so it doesn’t do this
ok just got my answer
lol
still though! come on I mean its just one line under it, it’s going to give the “this is a mutable property that might have changed by this time” error?
j
I guess that's the risk with a potentially multithreaded application - I think it won't give that warning for a local variable but for a field it can't provide a safety guarantee.
👆 2
s
requirementsAndInfo.key?.let { rTitleTv.text = it }
o
sure that’s a tighter way of writing it
s
you dont need the surrounding 'if' and the compiler error is gone