Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.