-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix: return NotNullIfNotNull #3704
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
Fix: return NotNullIfNotNull #3704
Conversation
| #if NET5_0_OR_GREATER | ||
| [return: NotNullIfNotNull(nameof(factory))] | ||
| #endif | ||
| public StorageItem? GetAndChange(StorageKey key, Func<StorageItem>? factory = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factory variable can be still be null
Take for example
var nullValue = GetAndChange(key, () => null);There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factoryvariable can be still benullTake for example
var nullValue = GetAndChange(key, () => null);
The factory definition is Func<StorageItem>
StorageItem, not StorageItem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neo is not a nullable project. So it can still be null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neois not anullableproject. So it can still benull.
https://github.com/neo-project/neo/blob/master/src/Neo/Persistence/DataCache.cs#L12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They just need to enable nullable in devpack


#3702 not works.
Checklist: