O'Reilly logo
  • MICHAEL MASLENKO thinks this is interesting:

One common pattern of using a safe cast is combining it with the Elvis operator. For example, this comes in handy for implementing the equals method

From

Cover of Kotlin in Action

Note

7 R+
...
val otherPerson = o as? Person ?: return false