Skip to content

Clarify delegate as built-in reference type in documentation #47668

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

Merged
merged 5 commits into from
Aug 4, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 30, 2025

This PR resolves confusion about whether delegate is a built-in type by clarifying the documentation in two key files.

Problem

Users were confused about whether delegate is a built-in type because:

  • The built-in-types.md page included delegate in the built-in reference types table but had confusing explanatory text that said "except delegate and dynamic" when discussing aliases
  • This created ambiguity about whether delegate was actually considered a built-in type

Changes Made

built-in-types.md

  • Changed the confusing phrase "except delegate and dynamic" to "most C# type keywords" to eliminate the implication that delegate and dynamic aren't built-in
  • Added a comprehensive explanation clarifying that delegate is indeed a built-in reference type keyword that declares types derived from the abstract System.Delegate type
  • Explained that unlike other built-in type keywords, delegate isn't a direct alias but declares custom derived types

reference-types.md

  • Added "built-in" qualifier to the delegate description to ensure consistency across documentation

Result

The documentation now clearly and consistently communicates that:

  • delegate is a built-in reference type keyword
  • It works differently from simple type aliases by enabling declaration of custom types that derive from System.Delegate
  • System.Delegate itself is abstract, which is why you can't instantiate it directly
  • Users create specific delegate types that inherit from this abstract base

This resolves the user's confusion while maintaining technical accuracy about how delegate types work in C#.

Fixes #28236.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/builtin-types/built-in-types.md docs/csharp/language-reference/builtin-types/built-in-types
docs/csharp/language-reference/builtin-types/reference-types.md docs/csharp/language-reference/builtin-types/reference-types

@Copilot Copilot AI changed the title [WIP] Understanding built-in Reference type Clarify delegate as built-in reference type in documentation Jul 30, 2025
@Copilot Copilot AI requested a review from BillWagner July 30, 2025 19:05
Copilot finished work on behalf of BillWagner July 30, 2025 19:05
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM and is ready for final review.

@BillWagner BillWagner marked this pull request as ready for review July 31, 2025 15:09
@BillWagner BillWagner requested a review from a team as a code owner July 31, 2025 15:09
@BillWagner BillWagner requested a review from tdykstra July 31, 2025 15:09
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Jul 31, 2025
Copilot finished work on behalf of gewarren August 4, 2025 18:39
@Copilot Copilot AI requested a review from gewarren August 4, 2025 18:39
@BillWagner BillWagner enabled auto-merge (squash) August 4, 2025 18:40
@BillWagner BillWagner merged commit 7c83e3f into main Aug 4, 2025
10 checks passed
@BillWagner BillWagner deleted the copilot/fix-28236 branch August 4, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc lang-reference/subsvc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Understanding built-in Reference type
3 participants