stephanc
04/16/2018, 1:06 PMbob?.department?.head?.name ?: "meh"
There is something like this:
bob.department.head.name ??: "meh"
orangy
bob?.let { it.department.head.name } ?: "no bob"
stephanc
04/16/2018, 1:20 PMorangy
department
or other properties are nullable. It might be suitable if bob
is nullable, but other properties are not, and all these safe calls are because of bobstephanc
04/16/2018, 1:26 PMstephanc
04/16/2018, 1:29 PMdalexander
04/16/2018, 2:52 PM.
operator changing based on some scoping mechanism.