You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The encoding/gob package emits an erroneous error message when attempting to encode a map containing irreflexive keys (such as math.NaN()): https://play.golang.org/p/QgRVchmloT6
The error message it returns is gob: encodeReflectValue: nil element, but encodeReflectValue is not part of the exported or documented API, and there are no nil elements involved.
Ideally, encoding/gob should correctly handle maps with irreflexive keys. That would likely require either a fix for #11104, or a change to map lookups to use representation equivalence instead of == (per #20660 (comment)).
If it isn't feasible for gob to handle irreflexive map keys, that restriction should be documented in the gob package, and the errors that gob methods return should describe the correct problem.
Uh oh!
There was an error while loading. Please reload this page.
The
encoding/gob
package emits an erroneous error message when attempting to encode a map containing irreflexive keys (such asmath.NaN()
):https://play.golang.org/p/QgRVchmloT6
The error message it returns is
gob: encodeReflectValue: nil element
, butencodeReflectValue
is not part of the exported or documented API, and there are nonil
elements involved.Ideally,
encoding/gob
should correctly handle maps with irreflexive keys. That would likely require either a fix for #11104, or a change to map lookups to use representation equivalence instead of==
(per #20660 (comment)).If it isn't feasible for
gob
to handle irreflexive map keys, that restriction should be documented in thegob
package, and the errors thatgob
methods return should describe the correct problem.This issue parallels #14427.
The text was updated successfully, but these errors were encountered: