groostav
copy
data class Thingy(val x: Double, val y: Int) val first = Thingy(1.0, 42) val second = first.copy(x = 2.0)
elizarov
x = 2.0
y = 3.0
someProperty
val second = first.copy(x = 2.0) val third = if (someProperty) second else second.copy(y = 3.0)
val second = first.copy(x = 2.0, y = if (someProperty) 3.0 else first.y)
A modern programming language that makes developers happier.