Bernhard
06/04/2025, 8:13 AMArtem Kobzar
06/04/2025, 8:49 AMcopy
method, so there is no more copy
method on the instance itself but on its companion object.
So, the following code will trigger the compilation error intentionally:
val user = User(name = "Artem", age = 26)
val copy = user.copy(age = 27) // Here will be a compilation error
So, such places should be reworked in the following way:
val user = User(name = "Artem", age = 26)
val copy = User.copy(user, age = 27) // No more compilation errors
Bernhard
06/04/2025, 8:50 AMBernhard
06/04/2025, 8:50 AMBernhard
06/04/2025, 8:50 AM