diff --git a/docs/fundamentals/code-analysis/style-rules/ide0340.md b/docs/fundamentals/code-analysis/style-rules/ide0340.md index 9d8d37aabc262..acba52eef0f2c 100644 --- a/docs/fundamentals/code-analysis/style-rules/ide0340.md +++ b/docs/fundamentals/code-analysis/style-rules/ide0340.md @@ -49,6 +49,11 @@ string name = nameof(List); string name = nameof(List<>); ``` +```csharp +// Both operands produce the same string. +bool sameName = nameof(List) == nameof(List<>); // true +``` + ## Suppress a warning If you want to suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.