-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add nullability to CreateInstance
in TypeDescriptor
/TypeDescriptionProvider
to match Activator.CreateInstance
#79776
Conversation
…onProvider to match Activator.CreateInstance
Tagging subscribers to this area: @dotnet/area-system-componentmodel Issue DetailsThis PR adds nullability to the Related: dotnet/winforms#8353, #79429
|
CC: @lonitra |
I am unsure if nullability on |
This PR appears to fix a nullability mismatch - it should hav always been |
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
Show resolved
Hide resolved
@steveharter what are your thoughts on this? Seems like |
In general, for such an API, it seems like a Type instance should always be specified (not null), unless it is unknown or for some reason hard to obtain. I assume that is not the case here, so Type[]? seems correct (not Type?[]?). |
That was my thought as well and why I wound back that change. It will also never match a constructor if we pass a null type. Since you can't define a parameter type as null, only nullable. |
Are there any changes required to get this merged? |
This PR adds nullability to the
args
parameter ofCreateInstance
to matchActivator.CreateInstance
. Thus enabling null to be passed as a parameter toTypeDescriptors
.Related: dotnet/winforms#8353, #79429
Tracking: dotnet/winforms#8342