Support Code Contracts for code analysis

Can you please add support for the Contracts when R# is determining possible code errors...

I have a Contract.Requires(someparam != null) as a precondition.  Later in the method, I'm warned that someparam.Blah is a possible null reference exception.

This is completely wrong in this case....

Comment actions Permalink


This hasn't been supported yet because the code in the Contracts is a bit
too much freehand (when compared to if-throw or ).

I think it's planned for some future version anyway.

Serge Baltic
JetBrains, Inc —
“Develop with pleasure!”

Comment actions Permalink

The code is defintely more freehand, but it also allows for more complex checking -- i.e., not only do I need a not-null array, but it must be at least length 1, etc.  Also, while the code contracts tooling (the rewriter, etc) is still under development, it's been pretty stable lately.  Also, as Microsoft.Contracts is in the .NET 4.0 BCL, the core interfaces/contracts are stable.


Comment actions Permalink

For now, we have no plans to support CodeContracts in our background analysis. (I mean full contract checking). Definitely some analysis concerning with nullity will be supported in the future

Comment actions Permalink

ues or internet retailers There are many specialty labels selling p After all the majority of wedding dresses just end up locked away in the attic never to see the light of day again or they end up in charity shops Shops specialise in offering good quality hire dresses along with mother of the bride As a wholesaler and distributor of fine mens formal wear Ascot offers a plan to Evening tuxedos businesses that is better than a tuxedo franchisebecause it requires no monetary investment to sta bridesmaids and grooms attire This is often a great way to save thousands of pounds on the dresses and still look good There are

Original message URL:


Please sign in to leave a comment.