Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #512.
As described in the issue, allowing null for
Value
breaks the assumed contract and leads to various inconsistencies.On top of that, the internal implementation assumes the
Value
won't be null. The equality operators, hash code, implicit/explicit operators, all of them are based on the premise that theValue
is not null.If the consumers need null (e.g. database columns), then the whole thing can be null, e.g.
MyEnum?
. But, once you have an instance of the enum, we should guarantee a non-nullValue
field.The PR #412 was merged and published as part of version 8 (not so long ago). If needed we can keep this PR open, until a larger consensus is reached on this topic.
PS. The
Name
indeed can be empty, or eventually null. We may add support for that I assume. Actually, that was the original request in this issue #302.