Yeah I just want the compiler to catch all my mist...
# getting-started
t
Yeah I just want the compiler to catch all my mistake for me, and this seemed like a real easy case for the compiler to check that for me
p
@Trevor What about logins[0], should this also return nullable type Login? or throw checked exception as list can be empty? 🙂
t
Ah! You got me @Pavlo Liapota, from that perspective you're right, I would expect an exception. so
logins[0]?
would be the equivalent of
firstOrNull
?
p
Such construction
logins[0]?
will be confusing when used together with operator
?.
Imagine
logins[0]?.name
, is it
logins[0]? . name
or
logins[0] ?. name