.NET Core: Code Contracts approach is closed for now?

泄露秘密 提交于 2020-08-19 12:15:27

问题


Some years ago was many information about Code Contracts. I did not have time to learn it and found this time only now :)

But when I try to use it, I see, that Visual Studio 2017 does not support it, CC tool is updated last time more than 3 years ago...

So, Code Contracts is closed for now?


回答1:


Sadly, Code Contracts is no longer supported.

The good news is that C#8 is going to include a new nullable reference types feature that will handle a large portion of the invariants and pre- and post-conditions for which Code Contracts was used. This will assist with detecting and avoiding possible null-reference exceptions.

The bad news is that there is no built-in support for other types of contracts, and nothing like it has been announced for the future.

Correctness guarantees will have to come from third-party tools, or another language will have to be used (e.g., Ada Spark).



来源:https://stackoverflow.com/questions/55174344/net-core-code-contracts-approach-is-closed-for-now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!