Uh oh!
There was an error while loading. Please reload this page.
Add nullability to CreateInstance in TypeDescriptor/TypeDescriptionProvider to match Activator.CreateInstance - #79776
Conversation
…onProvider to match Activator.CreateInstance
ghost
commented
Dec 17, 2022
Tagging subscribers to this area: @dotnet/area-system-componentmodel Issue DetailsThis PR adds nullability to the Related: dotnet/winforms#8353, #79429
|
elachlan
commented
Dec 17, 2022
CC: @lonitra |
I am unsure if nullability on |
steveharter
commented
Dec 20, 2022
This PR appears to fix a nullability mismatch - it should hav always been |
Uh oh!
There was an error while loading. Please reload this page.
lonitra
commented
Dec 21, 2022
@steveharter what are your thoughts on this? Seems like |
steveharter
commented
Dec 21, 2022
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?[]?). |
elachlan
commented
Dec 21, 2022
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. |
elachlan
commented
Dec 22, 2022
Are there any changes required to get this merged? |
This PR adds nullability to the
argsparameter ofCreateInstanceto matchActivator.CreateInstance. Thus enabling null to be passed as a parameter toTypeDescriptors.Related: dotnet/winforms#8353, #79429
Tracking: dotnet/winforms#8342