Hello, I'm not sure if it's a bug or I'm doing it ...
# announcements
t
Hello, I'm not sure if it's a bug or I'm doing it wrong. I'm trying to use
.copy()
provided by data class, but the result is not really what I want.
Copy code
data class Person(val name: String = "Tristan") {
    var age: Int = 1
}

fun main(args: Array<String>) {
    val person = Person()
    person.age = 3
    val personCloned = person.copy()
    println(personCloned.age) // It prints 1 and I was expecting 3
}
Can you give me some lights on it? Thank you.