Generated GetHashCode not safe from OverflowException

Recently I've been in the habit of setting "Check for arithmetic overflow/underflow" on for c# projects. This is when I noticed that the implementation of GetHashCode generated by Resharper is not really safe - it will often result in an overflow and therefore throw an exception.

I think Resharper needs to do a better job of generating the code so as to avoid this type of thing.

What do you think? Should this be added as a change request?

Thanks
Christian

2 comments
Comment actions Permalink

Hello,

We appreciate your feedback. The corresponding JIRA request has been created,
and you are welcome to monitor its status at http://www.jetbrains.net/jira/browse/RSRP-61925.

You may want to check our request tracking policy here: http://www.jetbrains.net/confluence/display/ReSharper/ReSharperIssueTracker

Best regards,
- Development Team.


0
Comment actions Permalink

Cool, thanks for adding to issue tracker

0

Please sign in to leave a comment.