SergeyTeplyakov / ReSharperContractExtensions

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

Warn for non-void return method in contract block #25

Closed SergeyTeplyakov closed 10 years ago

SergeyTeplyakov commented 10 years ago
public class WarningForMalformedContract
{
    public void WarningOnMethodCallWithResul()
    {
        // Detected expression statement evaluated for side-effect in contracts of method 'METHOD'
        //warning CC1069: Detected expression statement evaluated for potential side-effect in contracts of method 'RequiresInconsistentVisibility.WarningForMalformedContract.WarningOnMethodCallWithResul'.
        Enumerable.Range(1, 10);
        Contract.Requires(false);
    }
}
SergeyTeplyakov commented 10 years ago

image