Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas

PatilShreyas/DestructDecl.kt.diff Secret

Last active Dec 29, 2020
Embed
What would you like to do?
data class User(val id: Int, val name: String)
fun main() {
- val user = getUser()
- val userId = user.id
- val userName = user.name
+ val (userId, userName) = getUser()
}
fun getUser() = User(1, "John Doe")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment