-
-
Notifications
You must be signed in to change notification settings - Fork 407
remove redundant nullable #4608
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for catching these. Probably left overs from my work. I appreciate it!
Ah please solve the conflict. Thanks |
@@ -136,7 +136,7 @@ protected virtual void OnGetChildren(SerializationInfo info, MobileFormatter for | |||
List<int> references = new List<int>(); | |||
for (int x = 0; x < Count; x++) | |||
{ | |||
T? child = this[x]; | |||
T child = this[x]; |
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.
Shouldnt this still be
T?` because of the next line? Otherwise the check could be removed due to the missing annotation?
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.
no because MobileObservableCollection<T>
has no notnull
constraint.
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.
But exactly because of that we have to assume it can be nullable.
So T? child
is more correct than T
. With T
we don't express the possibility of the child
being null
so the compiler can help us avoiding possible null
errors?
No description provided.