Skip to content

Conversation

@rolfbjarne
Copy link
Member

  • Enable nullability.
  • Reuse existing code to create the native array.
  • Add tests.
  • Add xml docs.
  • Update nullability in some of the consumers of these methods whenever it makes sense.
  • Adjust CFArray.Create|FromStrings methods to match NSArray's equivalent methods.

Contributes towards #17285.

* Enable nullability.
* Reuse existing code to create the native array.
* Add tests.
* Add xml docs.
* Update nullability in some of the consumers of these methods whenever it makes sense.
* Adjust CFArray.Create|FromStrings methods to match NSArray's equivalent methods.

Contributes towards #17285.
Copy link
Contributor

Copilot AI left a 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 improves the NSArray.FromStrings methods and related CFArray methods by enabling nullability, adding better XML documentation, improving the implementation to reuse existing code, and adding comprehensive tests.

Changes:

  • Enabled nullability in NSArray.FromStrings and added a new FromNullableStrings method for nullable array inputs
  • Refactored NSArray.FromStrings to reuse CFArray.Create, eliminating duplicated marshaling logic
  • Updated CFArray.Create and FromStrings to accept nullable strings with proper documentation
  • Updated consumers (NSSet, NSOrderedSet, NSMutableSet) to accept nullable string arrays
  • Added comprehensive tests for both NSArray and CFArray with null items

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Foundation/NSArray.cs Refactored FromStrings to delegate to CFArray.Create, added FromNullableStrings method, improved XML docs, enabled nullability
src/CoreFoundation/CFArray.cs Enhanced Create method with IReadOnlyList overload, updated FromStrings signature, added XML documentation
tests/monotouch-test/Foundation/ArrayTest.cs Added tests for FromStrings with null items, IReadOnlyList, and FromNullableStrings
tests/monotouch-test/CoreFoundation/ArrayTest.cs Added tests for Create and FromStrings with null items and IReadOnlyList
src/bgen/Generator.cs Updated generator to use FromNullableStrings for nullable string arrays
src/Foundation/NSSet.cs Updated constructor to accept nullable string arrays
src/Foundation/NSOrderedSet.cs Updated constructors to accept nullable string arrays
src/Foundation/NSMutableSet.cs Updated constructor to accept nullable string arrays
src/CoreText/CTFont.cs Updated GetDefaultCascadeList to use FromNullableStrings
src/CoreServices/FSEvents.cs Fixed logic to properly check for null before checking Count

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #2ee33b6] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #2ee33b6] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #2ee33b6] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #2ee33b6] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #2ee33b6] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #2ee33b6] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #2ee33b6] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #2ee33b6] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #2ee33b6] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

4 tests crashed, 5 tests failed, 113 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppSizeTest.MonoVM_Interpreter(iOS,"ios-arm64"): App size changed significantly (+14,384 bytes (14.0 KB = 0.0 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...
    • Xamarin.Tests.AppSizeTest.MonoVM(iOS,"ios-arm64"): App size changed significantly (+42,640 bytes (41.6 KB = 0.0 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...
    • Xamarin.Tests.AppSizeTest.NativeAOT(iOS,"ios-arm64"): App size changed significantly (+14,640 bytes (14.3 KB = 0.0 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_tvos (no summary found).

Html Report (VSDrops) Download

❌ framework tests

🔥 Failed catastrophically on VSTS: test results - framework (no summary found).

Html Report (VSDrops) Download

❌ fsharp tests

1 tests failed, 3 tests passed.

Failed tests

  • fsharp/tvOS - simulator/Debug: Crashed

Html Report (VSDrops) Download

❌ generator tests

🔥 Failed catastrophically on VSTS: test results - generator (no summary found).

Html Report (VSDrops) Download

❌ interdependent-binding-projects tests

🔥 Failed catastrophically on VSTS: test results - interdependent-binding-projects (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

1 tests failed, 10 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Release (NativeAOT, ARM64): Crashed

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

1 tests failed, 11 tests passed.

Failed tests

  • monotouch-test/macOS/Release (static registrar, all optimizations): TimedOut (Execution timed out after 1200 seconds.
    Test run crashed)

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

1 tests failed, 10 tests passed.

Failed tests

  • monotouch-test/tvOS - simulator/Debug (managed static registrar): Crashed

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 2ee33b6ce4cbce754bacdec0a1df87e5ab3b2ff3 [PR build]

@rolfbjarne rolfbjarne marked this pull request as ready for review January 31, 2026 01:06
@rolfbjarne rolfbjarne enabled auto-merge (squash) January 31, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants