The `copy` function only copies the constructor pa...
# announcements
m
The
copy
function only copies the constructor parameters. You should do this:
Copy code
data class Person(val name: String = "Tristan", val age: Int = 1)

fun main(args: Array<String>) {
    val person = Person()
    val personCloned = person.copy(age = 3)
    println(personCloned.age)
}
t
okay thx
a
@Tristan Caron keep in mind that `equals`/`hashCode`/`copy`/etc. only take properties into account, that have been defined in the primary constructor