SergeyTeplyakov / ReSharperContractExtensions

Set of extensions for R# that simplifies Design by Contract programming using Code Contracts.
MIT License
69 stars 10 forks source link

Error when Contract.Requires/Ensures used after EndContractBlock #21

Closed SergeyTeplyakov closed 10 years ago

SergeyTeplyakov commented 10 years ago
public class MalformedContractErrors
{
    public void RequiresOrEnsuresAfterEndContractBlock()
    {
        Contract.EndContractBlock();
        // error CC1012: Contract call found after prior EndContractBlock.
        Contract.Ensures(true);
        Contract.Requires(false);

    } 
}
SergeyTeplyakov commented 10 years ago

image