var foo = someApi.someFoo() if (foo) foo.bar()
The direct translation in kotlin would be:
val foo = someApi.someFoo() if (foo != null && foo != undefined) foo.bar
This is very cumbersome. Another pain point is that the elvis operator and the safe call operator is obviously not working for undefined.
How do you best handle undefined in kotlin?