Repository navigation
Fix nullability bug in BindingContext - #2646
Conversation
|
Hmm this would definitely break |
|
Yes, if you don't want to take that breaking change you could rewrap the KVPs though. I don't think that method call is common since its hidden behind an explicit interface implementation, callers would have to cast to use it. This is probably also something to discuss in context of #2644 when implementing generic collection types, because it will determine whether we use |
Perhaps the more common case would be the following, that would throw an |
You are right of course. Lets not discuss changing implementation here, this belongs more into the discussion of #2644, its just a warning when doing nullability but for #2644 its a major decision what type you take as collection content (with the option to separate the decision out into its own issue). Thanks for bringing it up though! |
|
Also I think this warning is a false-positive, non-generic dictionaries won't return a null DictionaryEntry. Its probably not possible to express this with annotations though so you get a warning anyways. |
|
I tried suppressing it with |
|
Updated just to fix the nullability bug of |
Codecov Report
|
|
@RussKie how does this bug fix look? |
|
Thank you all |
Proposed Changes
ICollection.SyncRootreturn non-null valueTODOWe have the following warningsHappens in cases like below in
foreach (DictionaryEntry de in _listManagers), how are we unboxing a possibly null value/cc @weltkante
Microsoft Reviewers: Open in CodeFlow