pepe
08/21/2019, 11:04 AMfun <T: ???, R> T.setDefault(prop: KProperty1<T, R>, defaultValue: R): T =
prop.get(this)?.let { this } ?: copy(??? = defaultValue)
P.S. maybe this I'm trying to do is stupid/not worth it, feel free to point it outMike
08/21/2019, 11:43 AMRuckus
08/21/2019, 1:39 PMdata
is a compiler code generation feature. At runtime, there is nothing special about data classes.pepe
08/23/2019, 9:48 AM