Last active
May 18, 2018 20:02
-
-
Save soudmaijer/56aa28c0bce56a37d8f9af35cbd40104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun doStuffWithOrder(id: Long) { | |
val orderById: Order? = orderRepository.findOrderById(id) | |
orderById?.run { | |
// do stuff with order | |
} | |
orderById.id // Compiler error: Only safe ?. or non-null asserted calls are allowed on a nullable receiver of type Order? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment