Skip to content

Update obsolete receiver comment in C# 14 extension block sample - #54994

Merged
BillWagner merged 4 commits into
mainfrom
copilot/remove-obsolete-comment
Jul 22, 2026
Merged

Update obsolete receiver comment in C# 14 extension block sample#54994
BillWagner merged 4 commits into
mainfrom
copilot/remove-obsolete-comment

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The extension block sample on the extension members article used an outdated comment that referenced this, even though the sample uses extension(ref Account account). This update aligns the comment with current extension block receiver semantics.

  • What changed

    • Updated the comment in docs/csharp/programming-guide/classes-and-structs/snippets/ExtensionMembers/CustomExtensionMembers.cs to describe account as the receiver, analogous to the legacy this parameter.
    • Clarified that ref on the receiver means the receiver is passed by reference.
  • Snippet updated

    extension(ref Account account)
    {
        // account is the receiver (analogous to the this parameter in extension methods), and ref means the receiver is passed by reference
        public void Deposit(float amount)
        {
            account.balance += amount;
        }
    }

Copilot AI review requested due to automatic review settings July 22, 2026 13:35

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI linked an issue Jul 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Remove obsolete comment from extension methods example Update obsolete receiver comment in C# 14 extension block sample Jul 22, 2026
Copilot AI requested a review from BillWagner July 22, 2026 13:38
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is ready for final review.

@BillWagner
BillWagner marked this pull request as ready for review July 22, 2026 13:50
@BillWagner
BillWagner requested a review from a team as a code owner July 22, 2026 13:50
@BillWagner
BillWagner enabled auto-merge (squash) July 22, 2026 13:50
…ensionMembers/CustomExtensionMembers.cs

Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
@BillWagner
BillWagner merged commit efce12e into main Jul 22, 2026
11 checks passed
@BillWagner
BillWagner deleted the copilot/remove-obsolete-comment branch July 22, 2026 16:52
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.

Obselete comment

4 participants