Repository navigation
[Foundation] Improve nullability in NSArray.ArrayFromHandleFunc. - #24900
rolfbjarne merged 1 commit into
Conversation
* Improve nullability annotations for ArrayFromHandleFunc<T> (return T?[]?). * Add an ArrayFromHandleDropNullElements overload with Converter and NSNullBehavior parameters. * Update DictionaryContainer.GetArray and GetArrayOfDictionariesValue to use ArrayFromHandleDropNullElements. * Update NSUrlSessionConfiguration.ProxyConfigurations to use NonNullArrayFromHandleDropNullElements. * Update PdfAnnotation.QuadrilateralPoints to return CGPoint[]? and use ArrayFromHandle. * Update XML docs for ArrayFromHandleFunc, ProxyConfigurations and QuadrilateralPoints. 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 improves nullability annotations around NSArray.ArrayFromHandleFunc<T> and updates a few call sites to use APIs that better match the intended null/NSNull behavior in Foundation/PdfKit bindings (part of the ongoing Foundation nullability effort for #17285).
Changes:
- Update
NSArray.ArrayFromHandleFunc<T>to returnT?[]?and extendArrayFromHandleDropNullElementswith an overload that accepts a converter +NSNullBehavior. - Adjust
DictionaryContainerarray extraction andNSUrlSessionConfiguration.ProxyConfigurationsto use “drop null elements” helpers. - Update
PdfAnnotation.QuadrilateralPointsto be nullable (CGPoint[]?) and modernize array marshaling; update XML docs and cecil-doc known failures.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/cecil-tests/Documentation.KnownFailures.txt | Removes the known doc failure entry for ProxyConfigurations after doc updates. |
| src/PdfKit/PdfAnnotation.cs | Makes QuadrilateralPoints nullable and uses NSArray helpers for marshaling; updates XML docs. |
| src/Foundation/NSUrlSessionConfiguration.cs | Uses NonNullArrayFromHandleDropNullElements for getter; disposes temporary NSArray in setter; adds XML docs. |
| src/Foundation/NSArray.cs | Adds overload for ArrayFromHandleDropNullElements and updates nullability/docs for ArrayFromHandleFunc. |
| src/Foundation/DictionaryContainer.cs | Uses ArrayFromHandleDropNullElements when extracting arrays (including dictionary containers). |
You can also share your feedback on Copilot code review. Take the survey.
✅ [CI Build #577687a] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #577687a] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #577687a] Build passed (Build macOS tests) ✅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 comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #577687a] 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 |
Contributes towards #17285.