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....

4 comments
Comment actions Permalink

Hello,

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 — http://www.jetbrains.com
“Develop with pleasure!”


0
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.

Oren

0
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

0
Comment actions Permalink

ues http://www.hairhey.com 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 http://www.jewelryover.com/tiffany-bangles.html http://www.jewelryover.com 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 http://www.hairhey.com http://www.shoesmum.com

---
Original message URL: http://devnet.jetbrains.net/message/5274503#5274503

0

Please sign in to leave a comment.