Skip to content

Adjust description of cs0465 with the correct restriction - #55640

Open
adegeo wants to merge 1 commit into
mainfrom
adegeo/55617/finalizer
Open

Adjust description of cs0465 with the correct restriction#55640
adegeo wants to merge 1 commit into
mainfrom
adegeo/55617/finalizer

Conversation

@adegeo

@adegeo adegeo commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixed the signature
  • Simplified description of the problem
  • Linked to the finalizer docs

Fixes #55617


Internal previews

File Preview link
docs/csharp/language-reference/compiler-messages/cs0465.md Preview published page

Copilot AI lite review requested due to automatic review settings August 24, 2026 22:53
@adegeo
adegeo requested review from a team and BillWagner as code owners August 24, 2026 22:53
@dotnetrepoman dotnetrepoman Bot added this to the August 2026 milestone Aug 24, 2026
@adegeo adegeo changed the title Generalize description to prevent misleading reader Adjust description of cs0465 with the correct restriction Aug 24, 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.

Pull request overview

Updates the CS0465 compiler warning documentation to better reflect current compiler behavior and to point readers to the C# finalizer/destructor guidance.

Changes:

  • Updates the article metadata (ms.date) and adds ai-usage frontmatter.
  • Revises the warning explanation to avoid overstating a specific accessibility modifier and links to the C# finalizers documentation.
  • Minor wording/formatting adjustments around the example lead-in.
Suppressed comments (1)

docs/csharp/language-reference/compiler-messages/cs0465.md:18

  • The article mixes terminology (“destructor invocation” in the warning text vs “finalizer invocation” in the explanation). Consider using one term consistently, or explicitly clarify that C# destructors map to finalizers, to avoid confusion for readers.
A method named `Finalize` can interfere with finalizer invocation. To define a finalizer, declare `~TypeName()` instead of a `Finalize` method. For more information, see [Finalizers](../../programming-guide/classes-and-structs/finalizers.md).

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

Comment thread docs/csharp/language-reference/compiler-messages/cs0465.md
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

Successfully merging this pull request may close these issues.

CS0465 description doesn't match behavior

2 participants