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?
Steps to reproduce
- Create .net6 app
- Add CommunityToolkit.Diagnostics 8.0.0 NuGet package
- Add the following line of code
TypeExtensions.ToTypeString(typeof(IDictionary<,>))
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.
Describe the bug
TypeExtensions.ToTypeString throws the ArgumentOutOfRangeException exception for generic type definitions.
The easiest solution would be to add the following code in the FormatDisplayString method:
Reproducible in sample app?
Steps to reproduce
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.