Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn for using less accessible members in guards #14

Open
SergeyTeplyakov opened this issue Jul 12, 2014 · 0 comments
Open

Warn for using less accessible members in guards #14

SergeyTeplyakov opened this issue Jul 12, 2014 · 0 comments
Assignees
Milestone

Comments

@SergeyTeplyakov
Copy link
Owner

Warn for using less accessible members in guard methods marked with `ContractArgumentValidator':

public static class ContractValidator
{
    [ContractArgumentValidator]
    public static void Guard(bool condition)
    {
        if (condition)
            throw new Exception();
        Contract.EndContractBlock();
    }
}

class Sample
{
  public void Foo(string s)
  {
    ContractValidator.Guard(s != null);
  }
}

Note, that Code Contract compiler doesn't warn about this kind of issue and warn only when contract validation method itself uses less accessible members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant