-
Notifications
You must be signed in to change notification settings - Fork 554
[Foundation] Fix nullability in NSLayoutConstraint. #24434
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
[Foundation] Fix nullability in NSLayoutConstraint. #24434
Conversation
This is file 37 of 47 files with nullability disabled in Foundation.
Changes:
- Enabled nullability
- Fixed typos in file header ("palattable" -> "palatable", "INc" -> "Inc")
- Added proper XML documentation for all public members, replacing "To be added" placeholders
- Replaced include directives with inline documentation from NSLayoutConstraint.xml
- Made return types nullable where appropriate (AsNumber, FirstAnchor, SecondAnchor)
- Made view2 parameter nullable in Create method
- Added ArgumentNullException.ThrowIfNull checks for format and viewsAndMetrics parameters
- Removed all four [SupportedOSPlatform] attributes from FirstAnchor and SecondAnchor methods (none contained version numbers)
- Added see cref attributes for better documentation cross-referencing
- Fixed XML formatting and removed unnecessary whitespace
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 in NSLayoutConstraint.cs, one of 47 files with nullability disabled in Foundation. The changes include fixing typos in the file header, adding comprehensive XML documentation to replace "To be added" placeholders, making return types and parameters nullable where appropriate based on the underlying binding definitions, adding defensive null checks, and removing unnecessary platform attributes.
Key changes:
- Enabled
#nullable enableand fixed nullability annotations for return types and parameters - Corrected typos in the file header ("palattable" → "palatable", "INc" → "Inc", "FromVisualLayout" → "FromVisualFormat")
- Replaced XML include directives with inline documentation and improved documentation quality
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Foundation/NSLayoutConstraint.cs | Enabled nullability, added null checks for format and viewsAndMetrics parameters, made return types nullable for AsNumber, FirstAnchor, and SecondAnchor methods, made view2 parameter nullable in Create method, replaced placeholder documentation with detailed XML docs, and removed unnecessary SupportedOSPlatform attributes |
| docs/api/UIKit/NSLayoutConstraint.xml | Removed duplicated documentation entries that were inlined into the C# source file |
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.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
✅ [CI Build #43da3aa] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #43da3aa] 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 #43da3aa] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #43da3aa] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #43da3aa] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #43da3aa] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #43da3aa] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #43da3aa] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
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 #43da3aa] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 128 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This is file 37 of 47 files with nullability disabled in Foundation.
Changes:
Contributes towards #17285.