| ▲ | tsimionescu 3 hours ago | |
All of this would be valid, except that value classes still pretend that their fields can be private. This also has huge implications in a language that emphasises dynamic loading like Java. And it also flies in the face of all of the pretenses that ABI compatibility is sacrosanct and no feature that breaka it can be considered, that the design team often touts. | ||
| ▲ | usrusr 2 hours ago | parent [-] | |
Why pretend? "private" on value types just means nothing to see here except when you happen to be one of the functions conveniently namespaced with the struct. But I'd say that GP's complaint about inequality leaking makes no sense anyways, because what could be more unequal than different implementation, or different internal state implying different behavior down the line? The public subset isn't some arbitrary interface that could have different implementations. And even then, "equals under interface I1" would have to be considered a very special type of "equality", not the general case. | ||