You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Foundation] Fix nullability in NSMutableDictionary. (#24428)
* Enable nullability for NSMutableDictionary.cs.
* Fix interface implementations to match nullability contracts (IDictionary, IDictionary<NSObject, NSObject>).
* Make indexers' return type allow null, but disallow setting null values.
* Remove all 'To be added.' XML comments.
* Add comprehensive XML documentation for all public methods, properties, and indexers.
* Use proper 'see cref' attributes for type references in documentation.
* Fix ArgumentNullException to use nameof for parameter names.
* Remove an unused constructor.
Also add NSMutableDictionary tests for missing key behavior:
* Add tests to verify that accessing missing keys returns null.
* Test all indexer overloads (string, NSObject, NSString).
* Test ObjectForKey method with missing keys.
* Test TryGetValue with missing keys returns false and null output.
* Test IDictionary interface implementations (indexer and Contains).
* Ensure existing keys still work correctly after testing missing keys.
These tests document and verify the expected behavior when fetching
values for keys that don't exist in the dictionary.
This is file 34 of 47 files with nullability disabled in Foundation.
Contributes towards #17285.
---------
Co-authored-by: GitHub Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0 commit comments