You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For most usecases, ITypedElement.InstanceType is not nullable. However, when parsing incorrect data (e.g. json with an unknown property), the InstanceType cannot be determined and is null. Commonly, this will be detected after parsing, when errors are reported and the ITypedElement instance is subsequently abandoned. However, code dealing with parsing source nodes and serializers etc working with ITypedElement will have behaviour to correct for such null InstanceTypes and are expecting InstanceType to be null.
So, it is both nullable (in the context of parsing) and non-nullable (in almost every other context).
Having InstanceType nullable means that even for common usage, users have to deal with a Nullable InstanceType, which is a nuisance.
We can do three things:
Accept that it is nullable, and let everyone deal with it.
Make it non-nullable, but silently return null, so those who care can still deal with it.
Return a sentinel InstanceType (like Base, or a really clearly non-existing type name), so the specialized consumers can still handle it, while the other consumers do not have to bother with it.
In all cases, we have determined that this would be a breaking change.
The text was updated successfully, but these errors were encountered:
For most usecases, ITypedElement.InstanceType is not nullable. However, when parsing incorrect data (e.g. json with an unknown property), the InstanceType cannot be determined and is null. Commonly, this will be detected after parsing, when errors are reported and the ITypedElement instance is subsequently abandoned. However, code dealing with parsing source nodes and serializers etc working with ITypedElement will have behaviour to correct for such null InstanceTypes and are expecting InstanceType to be null.
So, it is both nullable (in the context of parsing) and non-nullable (in almost every other context).
Having InstanceType nullable means that even for common usage, users have to deal with a Nullable InstanceType, which is a nuisance.
We can do three things:
In all cases, we have determined that this would be a breaking change.
The text was updated successfully, but these errors were encountered: