(no title)
_old_dude_ | 7 months ago
For me, this is where lies the design flaw, trying to support both inheritance and be immutability at the same time.
_old_dude_ | 7 months ago
For me, this is where lies the design flaw, trying to support both inheritance and be immutability at the same time.
ethan_smith|7 months ago
louthy|7 months ago
You could even imagine a compiler generated virtual method: `OnCloneReinitialiseFields()`, or something, that just re-ran the init-property setters (post clone operation).
Is there some other inheritance issue that is problematic here? Immutability isn't a concern, it's purely about what happens after cloning an object, whether the fields are immutable or not doesn't change the behaviour of the `with` operation.
hvb2|7 months ago
I've seen people use records for value based equality and to use for things like dictionary keys. Immutability in c# just doesn't exist, any attempt to achieve it is flawed from the start