[ObjCRuntime] Enable nullability and clean up Stret.#24732
Conversation
This is file 3 of 7 files with nullability disabled in ObjCRuntime. * Enable nullability (#nullable enable). * Add null argument validation for stret helpers to improve static analysis and runtime diagnostics. * Add nullable-safe handling for reflection-based attributes and ByValArray element types. * Improve XML documentation comments by adding missing public API docs. Contributes towards #17285. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR enables nullability in Stret.cs, which is part of an effort to add nullability to ObjCRuntime files (issue #17285). The file is shared between product assemblies and the generator tool, requiring special handling for conditional compilation.
Changes:
- Enabled
#nullable enableand added null argument validation usingArgumentNullException.ThrowIfNull - Made reflection API calls null-safe by casting results to nullable types and checking for null
- Added a
GetTypeNamehelper method for consistent type name formatting in error messages - Enhanced XML documentation for public methods
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #1250ca6] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #1250ca6] Build passed (Detect API changes) ✅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 |
✅ [CI Build #1250ca6] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #1250ca6] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #1250ca6] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #1250ca6] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #1250ca6] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #1250ca6] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
🚀 [CI Build #1250ca6] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 131 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This is file 3 of 7 files with nullability disabled in ObjCRuntime.
Contributes towards #17285.