[Foundation] Add [NullAllowed] to NSBundle members. Fixes #24803.#24805
[Foundation] Add [NullAllowed] to NSBundle members. Fixes #24803.#24805rolfbjarne merged 1 commit intomainfrom
Conversation
Add missing [NullAllowed] attributes on return types and parameters for Foundation.NSBundle members as reported by xtro-sharpie tests. Remove the corresponding entries from the ignore files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Fixes #24803.
There was a problem hiding this comment.
Pull request overview
Updates the Foundation NSBundle bindings to correctly reflect Apple SDK nullability contracts (particularly for resource lookup APIs), and aligns xtro-sharpie annotation expectations by removing now-unnecessary ignore entries.
Changes:
- Added missing
[NullAllowed]/[return: NullAllowed]annotations to multipleNSBundleproperties and methods insrc/foundation.cs(includingGetUrlForResourceoverloads and several path/url helpers). - Updated
NSBundlepath/resource APIs to accept nullablename/fileExtensionparameters where Apple headers allownil. - Removed corresponding xtro-sharpie ignore entries now that the bindings match expected nullability.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/foundation.cs |
Adds [NullAllowed] and [return: NullAllowed] to NSBundle members to match native nullability behavior/contracts. |
tests/xtro-sharpie/api-annotations-dotnet/common-Foundation.ignore |
Removes NSBundle-related “missing-null-allowed” ignores that should now be resolved by the binding updates. |
tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore |
Removes NSBundle AppKit-additions ignore entries now covered by new return nullability annotations. |
tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore |
Drops the NSBundle.LoadNib(...) ignore entry now that the return is annotated nullable. |
tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore |
Drops the NSBundle.LoadNib(...) ignore entry now that the return is annotated nullable. |
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.ignore |
Drops the NSBundle.LoadNib(...) ignore entry now that the return is annotated nullable. |
✅ [CI Build #4bbbb0a] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #4bbbb0a] 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 #4bbbb0a] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #4bbbb0a] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 156 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Add missing [NullAllowed] attributes on return types and parameters
for Foundation.NSBundle members as reported by xtro-sharpie tests.
Remove the corresponding entries from the ignore files.
Fixes #24803.