Skip to content

Use Code Contracts when the rewriter is enabled #2

@sharwell

Description

@sharwell

When the Code Contracts rewriter is enabled (see DotNetAnalyzers/Proposals#1), the code fix behavior should change in two ways:

  1. The added code should be Contract.Requires<ArgumentNullException>(p != null, nameof(p));
  2. The refactoring should only apply to a base method, and not to methods which override a base implementation and/or implement an interface method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions