4 ms·
It’s not a problem here, but if the type doesn’t guarantee reference equality for equal value, you’d also need a test to differentiate between a == b And
by fiddlerwoaroof 5y ago
It’s not a problem here, but if the type doesn’t guarantee reference equality for equal value, you’d also need a test to differentiate between
a == b
And (in Java)
a.equals(b)
In order to catch misguided refactorings. (I’ve introduced bugs this way before I learned that == can give a false positive for strings if the strings are interned)
- merb 5y agoin java the method that takes two `int`s would still use ==. java has value types which don't need `equals`.
- fiddlerwoaroof 5y agoYeah, that’s why I said “it’s not a problem here”.