Created
September 11, 2017 16:34
-
-
Save adam-arold/d81a7681415e4988c72fd23fd923efcd to your computer and use it in GitHub Desktop.
Kotlin user
This file contains hidden or 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
data class KotlinUser(val firstName: String, | |
val lastName: String, | |
val addresses: List<Address> = listOf()) { | |
data class Address(val city: String) | |
/** | |
* This is the same as in `JavaUser`. | |
*/ | |
fun getFirstAddressNoInference(): Address { | |
val firstAddress: Address = addresses.first() | |
return firstAddress | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment