karelpeeters
09/15/2017, 3:31 PMPerson("Dave", age = 30)
is also resolvable at compile-time. Is there anything else that requires const
?Ruckus
09/15/2017, 3:38 PMkarelpeeters
09/15/2017, 3:39 PMbenleggiero
09/15/2017, 4:41 PMPerson("Dave", age = 30)
could also invoke a init
block, adding logic that can't be known at compile time, such as serialization, network requests, and GUI operationskarelpeeters
09/15/2017, 4:43 PMdata class Person(val name: String, val age: Int)
right below it.benleggiero
09/15/2017, 5:03 PMdata class Person(val name: String, val age: Int) {
init {
println("Oops")
}
}
const data class
that doesn't allow any initializer logic, and whose parameters must be const
as well?inline data class
idea