Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/fundamentals/code-analysis/quality-rules/ca1716.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ helpviewer_keywords:
- CA1716
author: gewarren
ms.author: gewarren
dev_langs:
- CSharp
---
# CA1716: Identifiers should not match keywords

Expand Down Expand Up @@ -43,6 +45,10 @@ Case-insensitive comparison is used for Visual Basic keywords, and case-sensitiv

Select a name that does not appear in the list of keywords.

## Example

:::code language="csharp" source="snippets/csharp/all-rules/ca1716.cs" id="snippet1":::

## When to suppress warnings

You can suppress a warning from this rule if you're sure that the identifier won't confuse users of the API, and that the library is usable in all available languages in .NET.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace ca1716
{
//<snippet1>
// This code violates the rule.
public class Class { }
public class Event { }
public class String { }
public class Namespace { }
public class Object { }
public class Public { }
public class Static { }
//</snippet1>
}