-
Notifications
You must be signed in to change notification settings - Fork 551
[Foundation] Fix nullability in NSStream. #24308
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
Conversation
This is file 18 of 47 files with nullability disabled in Foundation. Changes: - Enabled nullable reference types - Removed four [SupportedOSPlatform] attributes without version numbers from NSStreamSocksOptions class - Made fields in NSStreamSocksOptions nullable where appropriate (HostName, Username, Password) - Made return types nullable: indexer, SocksOptions, DataWrittenToMemoryStream, FileCurrentOffset, and out parameters in CreatePair methods - Replaced xml include directive with inline documentation from Item(Foundation.xml file - Removed Item(Foundation.xml file as it only contained the now-inlined documentation - Replaced "To be added." XML documentation with proper documentation for all methods and properties - Added see cref attributes throughout for better cross-referencing - Removed unnecessary whitespace in XML comments - Replaced manual null checks with ArgumentNullException.ThrowIfNull - Fixed typo in example code (Passowrd -> Password) - Improved formatting and consistency in XML documentation Contributes towards #17285.
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.
Pull Request Overview
This PR enables nullable reference types for NSStream.cs as part of the ongoing effort to enable nullability across the Foundation namespace. The changes focus on proper null safety annotations and documentation improvements.
- Enabled
#nullable enableand added nullable annotations to properties, fields, and method parameters where appropriate - Replaced manual null checks with
ArgumentNullException.ThrowIfNullfollowing established patterns - Improved XML documentation by inlining external documentation, adding proper cross-references, and fixing inconsistencies
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Foundation/NSStream.cs | Enabled nullable reference types, added nullable annotations to properties/parameters/fields, replaced manual null checks with ArgumentNullException.ThrowIfNull, improved and inlined XML documentation, removed unnecessary SupportedOSPlatform attributes from NSStreamSocksOptions class, and fixed typo in example code |
| docs/api/Foundation.NSStream/Item(Foundation.xml | Removed file as its documentation was inlined into NSStream.cs |
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.
…ullability-18-nsstream
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.
…ullability-18-nsstream
✅ [CI Build #79cc511] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #79cc511] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #79cc511] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #79cc511] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #79cc511] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #79cc511] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #79cc511] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #79cc511] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) 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 |
🚀 [CI Build #79cc511] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 130 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This is file 18 of 47 files with nullability disabled in Foundation.
Changes:
Contributes towards #17285.