Skip to content

Use unbound generic type (IDE0340): extended example with clarification - #56111

Open
deep-outcome wants to merge 2 commits into
dotnet:mainfrom
deep-outcome:deep_outcome/IDE0340_clarification
Open

deep-outcome wants to merge 2 commits into
dotnet:mainfrom
deep-outcome:deep_outcome/IDE0340_clarification

Conversation

@deep-outcome

@deep-outcome deep-outcome commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds clarifying example on why to use unbound generic type name in nameof operator.


Internal previews

File Preview link
docs/fundamentals/code-analysis/style-rules/ide0340.md Learn preview

Build report

@deep-outcome
deep-outcome requested review from a team and gewarren as code owners September 16, 2026 22:19
@dotnetrepoman dotnetrepoman Bot added this to the September 2026 milestone Sep 16, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Sep 16, 2026
@gewarren
gewarren requested a lite review from Copilot September 22, 2026 15:30
@gewarren gewarren closed this Sep 22, 2026
@gewarren gewarren reopened this Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Complete the comparison example so it is valid compilable C#.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Clarifies IDE0340 with an example comparing bound and unbound generic types in nameof.

Changes:

  • Adds a comparison showing equivalent nameof results.
File Summary
docs/​fundamentals/​code-analysis/​style-rules/​ide0340.md Adds the extended example; the comparison should be a complete valid C# statement.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/fundamentals/code-analysis/style-rules/ide0340.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants