This message was deleted.
# getting-started
s
This message was deleted.
c
Examples in the ticket show a class not a data object?
f
when you create a data class, the compiler generates
copy
methods with default arguments. If you then define your own copy method, it won't compile because the method is already defined. It's not reserved, it's just that the method is automatically generated and your own one clashes with it
c
the ticket refers to the new
data object
construct that doesn’t support
copy
as objects are singletons.
f
yes, a
data object
is just a singleton so a copy does't make sense.
c
correct. so if there is no copy method generated, why does Kotlin prevent providing one named that? (regardless of what that method does or whether its appropriate)
f
it's interesting that the error is the same as for data classes, but the decompiled bytecode does not have a
copy
method
c
exactly.
likely somewhere in the compiler theres something shared between data objects and data classes that gets this wrong.
yea, it shouldn’t be possible for syntactically valid Kotlin to crash the compiler. bug somewhere.