Project

General

Profile

Bug #14263 » object-eql-documentation-tweak.patch

Patch to documentation for Object#eql? to add warning regarding hash equality - styrmis (Stefan Magnuson), 03/25/2018 09:38 PM

View differences:

object.c
*
* The <code>eql?</code> method returns <code>true</code> if +obj+ and
* +other+ refer to the same hash key. This is used by Hash to test members
* for equality. For objects of class <code>Object</code>, <code>eql?</code>
* for equality. In subclasses, breaking this link between <code>eql?</code>
* and the hash value will result in undefined behaviour.
*
* For objects of class <code>Object</code>, <code>eql?</code>
* is synonymous with <code>==</code>. Subclasses normally continue this
* tradition by aliasing <code>eql?</code> to their overridden <code>==</code>
* method, but there are exceptions. <code>Numeric</code> types, for
(4-4/4)