-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use Code Contracts when the rewriter is enabled #2
Comments
Equality operators can be overridden
|
|
In which case, comparison with
The code contracts rewriter automatically inserts the precondition checks from base methods into the compiled bytecode of derived methods. In addition, an error is reported if a derived method contains calls to |
BTW, error in derived method can be prevented. Base contract can be wrong/closed code, and must be possible to override. I noticed long time ago that |
In one sentence, thinking "out of the box":
|
When the Code Contracts rewriter is enabled (see DotNetAnalyzers/Proposals#1), the code fix behavior should change in two ways:
Contract.Requires<ArgumentNullException>(p != null, nameof(p));
The text was updated successfully, but these errors were encountered: