-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
object.GetHashCode not working #390
object.GetHashCode not working #390
Comments
That's not working because |
Any other thoughts on this? 😉 |
Even though it should not be used as a unique object identifier, won't it be better to at least have it work like the standard implementation? |
OK. Digging deeper I could find an old native implementation for this call here Guess we can try to accomplish something similar for objects, instead of relying on calculating the hash from fields. Or, perhaps, if there are no fields then return the CRC32 of the heap block address? |
I think calculating the hash of the fields is in general a good idea. Implementing a complicated algorithm would waste memory and time. I thinks we should improve what we have and return the CRC32 of the heap block address if the instance has no fields. |
Suppose we have an agreement on this. Let's go for it |
Suppose we have an agreement on this. Let's go for it |
Details about Problem
nanoFramework area: nanoCLR
Worked before? I think no.
Detailed repro steps so we can see the same problem
Write this C# program:
And all three (ha, hb and hc) are zero. GetHashCode returns alsways zero.
Tested with Prewiew 791 on an ESP32.
The text was updated successfully, but these errors were encountered: