I am just getting started with Code Contracts, and need a little help in correcting an error:
Given this code:
class MyClass
{
private bool _isUsed = false;
public void SomeMethod()
{
Contract.Requires(!_isUsed);
}
}
I get the following error:
error CC1038: Member 'MyClass._isUsed' has less visibility than the enclosing method 'MyClass.SomeMethod'
which seems to makes alot of the standard checks unavailable. What am I missing in this example?