|
|
|
|
|
by alkonaut
526 days ago
|
|
I think the agreement is rather “if you change the private field then there are no longer any guarantees of anything”. Which is fine, I think. And obviously with or without reflection anyone can already modify the private field. |
|
> And obviously with or without reflection anyone can already modify the private field.
This bit, I don't understand. Wouldn't that require unsafe?
EDIT: Just to say: Abstract data types usually require upholding some invariants which all the operations on those data types must uphold at entry/exit. If anyone can do whatever, then what's left othen than just a bag of bytes?