[Foundation] Fix nullability in NSKeyedArchiver.#24436
Conversation
This is file 38 of 47 files with nullability disabled in Foundation. Changes: - Enabled nullability - Added proper XML documentation for all public members, replacing "To be added" placeholders - Made GlobalGetClassName return type nullable (string?) - Replaced ObjCRuntime.ThrowHelper.ThrowArgumentNullException with ArgumentNullException.ThrowIfNull - Added see cref attributes for better documentation cross-referencing - Fixed XML formatting and removed unnecessary whitespace - Documented the relationship between global and instance-specific methods Contributes towards #17285.
There was a problem hiding this comment.
Pull request overview
This PR enables nullable reference types in NSKeyedArchiver.cs, which is part of an ongoing effort to modernize the Foundation namespace (file 38 of 47). The changes improve code safety and documentation quality while maintaining backward compatibility.
Key Changes
- Enabled nullable reference types with
#nullable enable - Updated
GlobalGetClassNamereturn type tostring?to properly reflect that it can return null - Replaced
ObjCRuntime.ThrowHelper.ThrowArgumentNullExceptionwithArgumentNullException.ThrowIfNull(appropriate for .NET 9+) - Added comprehensive XML documentation for both methods with proper cross-references
✅ [CI Build #ed11acf] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #ed11acf] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #ed11acf] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #ed11acf] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #ed11acf] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #ed11acf] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
💻 [CI Build #ed11acf] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #ed11acf] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #ed11acf] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 121 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This is file 38 of 47 files with nullability disabled in Foundation.
Changes:
Contributes towards #17285.