-
Notifications
You must be signed in to change notification settings - Fork 6k
Document breaking change for Type.MakeGenericSignatureType argument validation in .NET 10 Preview 3 #49124
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
Conversation
…rgument validation Co-authored-by: gewarren <[email protected]>
docs/core/compatibility/reflection/10/makegeneric-signaturetype-validation.md
Show resolved
Hide resolved
docs/core/compatibility/reflection/10.0/makegeneric-signaturetype-validation.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/reflection/10.0/makegeneric-signaturetype-validation.md
Outdated
Show resolved
Hide resolved
…d remove Preview 3 from New behavior section Co-authored-by: gewarren <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR documents a breaking change in .NET 10 Preview 3 where Type.MakeGenericSignatureType now validates that the genericTypeDefinition argument is actually a generic type definition, throwing an ArgumentException if validation fails.
- Creates comprehensive documentation for the breaking change with proper API references and code examples
- Updates the compatibility documentation index to include the new breaking change entry
- Adds a new Reflection section to the .NET 10 compatibility table of contents
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/core/compatibility/toc.yml | Adds new Reflection section under .NET 10 with entry for the breaking change |
| docs/core/compatibility/reflection/10/makegeneric-signaturetype-validation.md | Creates the main breaking change documentation with detailed explanation and examples |
| docs/core/compatibility/10.0.md | Adds entry to the Core .NET libraries section referencing the new breaking change document |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Fixes #48902
This PR adds documentation for a breaking change in .NET 10 Preview 3 where
Type.MakeGenericSignatureTypenow validates that thegenericTypeDefinitionargument is actually a generic type definition.Changes
Previous Behavior
The
Type.MakeGenericSignatureTypeAPI accepted any type for thegenericTypeDefinitionargument, including non-generic types, which resulted in non-sensical behavior.New Behavior
Starting in .NET 10, the API requires the
genericTypeDefinitionargument to be a generic type definition and throws anArgumentExceptionif the validation fails.Recommended Action
Developers should check if a type is a generic type definition before calling the API:
Files Changed
docs/core/compatibility/reflection/10/makegeneric-signaturetype-validation.mddocs/core/compatibility/10.0.mdto add entry in Core .NET libraries sectiondocs/core/compatibility/toc.ymlto add new Reflection section under .NET 10This is a behavioral breaking change that affects the
System.Type.MakeGenericSignatureTypeAPI.Original prompt
Fixes #48902
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Internal previews