Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify extension method access #42808

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Oct 2, 2024

Extension methods must be declared in top-level types. They aren't allowed in nested types.


Internal previews

📄 File 🔗 Preview link
docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method.md docs/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method

Extension methods can only be declared in top-level type. They can't be declared in nested types.
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

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

Thank you!

@BillWagner BillWagner enabled auto-merge (squash) October 2, 2024 17:04
@BillWagner BillWagner merged commit 3ce2e97 into dotnet:main Oct 2, 2024
8 checks passed
@BillWagner BillWagner deleted the clarify-extension-method-access branch October 2, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants