ITypedElement.InstanceType: nullable or not? #2750
Labels
breaking change
This issue/commit causes a breaking change, and requires a major version upgrade
enhancement
to be triaged
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: