An object (or object tree) to be cloned may have some properties marked as readonly to prevent accidental modification in a (shared) object.
In the clone, the properties should be modifiable in this use case. I also believe this is the main use case for readonly, so changing the return type should not introduce new problems.
(Alternatively, two different signatures could be provided; but I think this will needlessly complicate things.)
An object (or object tree) to be cloned may have some properties marked as
readonly
to prevent accidental modification in a (shared) object.In the clone, the properties should be modifiable in this use case. I also believe this is the main use case for
readonly
, so changing the return type should not introduce new problems.(Alternatively, two different signatures could be provided; but I think this will needlessly complicate things.)