Uno.CodeGen
Uno.CodeGen copied to clipboard
EqualityHash should work with enums
I'm submitting a...
- Bug report (I searched for similar issues and did not find one)
Current behavior
Writing this:
[EqualityHash]
public DayOfWeek DayOfWeek { get; }
yields this warning:
Type
DayOfWeek
of memberDayOfWeek
doesn't implements .GetHashCode(): it won't be used for hash computation. If you can't change the type System.DayOfWeek, you should use a custom hash method or a custom comparer. Alternatively, use something else for hash computation.
Expected behavior
No warning. The numerical value from the enum should be used for the hashcode computation.
Environment
Nuget Package: Uno.Equality
Package Version(s): 1.27.0
Affected platform(s):
- [x] iOS
- [x] Android
- [x] WebAssembly
- [x] Windows
- [ ] Build tasks
Visual Studio
- [x] 2017 (version: )
- [x] 2017 Preview (version: )
- [ ] for Mac (version: )
Relevant plugins
- [ ] Resharper (version: )