Skip to content
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

Reverted PR 412 #518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Reverted PR 412 #518

wants to merge 1 commit into from

Conversation

fiseni
Copy link

@fiseni fiseni commented Apr 24, 2024

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 the Value 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-null Value 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert PR 412 and remove support for null values.
1 participant