-
Notifications
You must be signed in to change notification settings - Fork 548
[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
base: main
Are you sure you want to change the base?
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.
🚀 [CI Build #ad777a0] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #ad777a0] 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 |
This is file 18 of 47 files with nullability disabled in Foundation.
Changes:
Contributes towards #17285.