But that can cause bugs: it's easy for programmers to forget to use opEquals instead of opBinary("==").

Again, opBinary and opEquals are simply functions. There is nothing special about their existence, just about how the compiler rewrites the operators into calling those functions. The fact that opBinary does not get called is the same as defining a function that does not get called. These kinds of errors are appropriate for a lint tool.


Seconded.
The language specification is clear about that. == is not to be used with opBinary.

Reply via email to