Skip to content

Conversation

@rolfbjarne
Copy link
Member

This is file 41 of 47 files with nullability disabled in Foundation.

  • Removes SupportedOSPlatform attributes without version numbers.
  • Enables nullability and adds nullability attributes where appropriate.
  • Replaces 'To be added' XML comments with proper documentation.
  • Adds missing XML documentation for all public members.
  • Uses ArgumentNullException.ThrowIfNull consistently.
  • Uses modern C# array syntax ([]) for empty arrays.
  • Improves IDictionary interface implementation to properly handle missing keys.
  • Adds some tests.

Contributes towards #17285.

This is file 41 of 47 files with nullability disabled in Foundation.

* Removes SupportedOSPlatform attributes without version numbers.
* Enables nullability and adds nullability attributes where appropriate.
* Replaces 'To be added' XML comments with proper documentation.
* Adds missing XML documentation for all public members.
* Uses ArgumentNullException.ThrowIfNull consistently.
* Uses modern C# array syntax ([]) for empty arrays.
* Improves IDictionary interface implementation to properly handle missing keys.
* Adds some tests.

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 enables nullable reference types for NSDictionary<TKey, TValue> in the Foundation namespace, part of an ongoing effort to enable nullability across 47 files (this is file 41). The changes improve code safety through nullability annotations, modernize the code with C# best practices, and enhance documentation quality by replacing placeholder XML comments with detailed descriptions.

Key changes:

  • Enables #nullable and adds appropriate nullability annotations throughout the class
  • Replaces ArgumentNullException null checks with ArgumentNullException.ThrowIfNull for consistency
  • Uses modern C# empty array syntax [] instead of new TValue[] {}
  • Adds comprehensive XML documentation for all public members
  • Adds tests for missing key access scenarios to verify IDictionary interface behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Foundation/NSDictionary_2.cs Enables nullability, adds proper XML documentation, uses modern C# syntax, and improves IDictionary implementation with correct nullability annotations
tests/monotouch-test/Foundation/NSDictionary2Test.cs Adds comprehensive tests for missing key scenarios, validating that both class and IDictionary interface return null instead of throwing exceptions
tests/cecil-tests/Documentation.KnownFailures.txt Removes entries for methods and properties that now have proper documentation
src/NaturalLanguage/NLLanguage.cs Refactors enumeration pattern to use KeyValuePair iteration for improved efficiency

@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.

@rolfbjarne rolfbjarne enabled auto-merge (squash) December 17, 2025 07:48
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #398a8b4] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #398a8b4] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [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: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #398a8b4] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@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

🚀 [CI Build #398a8b4] 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
✅ dotnettests (iOS): 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
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 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: 398a8b45ec69ae3ab68cdef2f4797191de8472a5 [PR build]

@rolfbjarne rolfbjarne merged commit 5cf3775 into main Dec 18, 2025
45 checks passed
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.

4 participants