Maybe<T>.None == null returns false
See original GitHub issueConsider the following:
Maybe<Class> maybeClassFromEmpty = null;
Console.WriteLine(maybeClassFromEmpty == null); // returns false
Considering that Maybe<T> implicitly converts null to Maybe<T>.None I’d expect comparing it with null to return true
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
c# - Why doesn't null evaluate to false?
A condition only accepts Boolean values, null does not have the type Boolean so it doesn't work there. As for the NULL example...
Read more >Is it better to return NULL or empty values from functions ...
This is because I want the computation to terminate normally and tell me that the function I have requested is not defined on...
Read more >'is null' returns false on null objects
This statement is always true. However "not null" UnityEngine. Objects can be "unusable" and they fake to be null to indicate that state....
Read more >Null in Python: Understanding Python's NoneType Object
Understanding Null in Python. None is the value a function returns when there is no return statement in the function: >>>
Read more >Attributes interpreted by the C# compiler: Nullable static ...
not-null: Static analysis determines that a variable has a non-null value. ... If the return value is false, the value of message is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@pfitoussi
That’s not right in 100% cases. You’re right that value type could never be null, however value type can provide it’s own implemetation of
==(which can return true).Let me summarize:
Thank you!