Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A number of edge-cases #48

Open
puellanivis opened this issue Aug 18, 2021 · 1 comment
Open

A number of edge-cases #48

puellanivis opened this issue Aug 18, 2021 · 1 comment

Comments

@puellanivis
Copy link

I’m documenting a few edge-case bugs that came up while I was tinkering with the package. I have a branch with fixes for most of the currently open issues as well as the ones below. I just want to have them written down some where just in case I don’t get the PR open, and my code falls into the void.

The weirds:

  • the code will panic if a type implements the wrong return value for Equal. Say func (Type) Equal(Type) int.
  • the code will erroneously report zero and negative zero as inequal, but these values == as true.
  • the code is treating value.IsValid() as a definitive dereferenced nil-pointer, but this is not guaranteed. (Fixing this requires checking for the nil-pointers before derefing with .Elem(). When fixed, this lets us be a little more specific between <invalid value> and <nil pointer>)
  • deep.Equal(nil, bType) is not strictly comparing a <nil pointer> to a bType, but rather an “untyped nil”, which compares as inequal to a typed nil-pointer. (The bane of everyone who wonders how their return nil function could possible not compare equal to nil in the caller)
@daniel-nichter
Copy link
Member

Keeping this issue open in case others encounter these edge case and/or someone wants to fix and PR against the latest version of this pkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants