-
Notifications
You must be signed in to change notification settings - Fork 375
Closed
Labels
bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviordiagnostics 🔬Issues/PRs for the Diagnostics packageIssues/PRs for the Diagnostics package
Description
Describe the bug
TypeExtensions.ToTypeString throws the ArgumentOutOfRangeException exception for generic type definitions.
TypeExtensions.ToTypeString(typeof(IDictionary<,>))The easiest solution would be to add the following code in the FormatDisplayString method:
if (type.IsGenericTypeParameter)
{
return type.Name;
}Reproducible in sample app?
- This bug can be reproduced in the sample app.
Steps to reproduce
- Create .net6 app
- Add CommunityToolkit.Diagnostics 8.0.0 NuGet package
- Add the following line of code
TypeExtensions.ToTypeString(typeof(IDictionary<,>))- Run project
Expected behavior
No exception.
Nuget packages
CommunityToolkit.Diagnostics 8.0.0
Help us help you
Yes, I'd like to be assigned to work on this item.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviordiagnostics 🔬Issues/PRs for the Diagnostics packageIssues/PRs for the Diagnostics package