Skip to content

Conversation

@rolfbjarne
Copy link
Member

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

  • Enabled nullable reference types.
  • Made ObjectForKey return nullable TValue? since keys may not exist.
  • Made TryGetValue parameter nullable with NotNullWhen(true) attribute.
  • Kept IDictionary interface implementations non-nullable per .NET contract.
  • Replaces 'To be added' XML comments with proper documentation.
  • Verifies and improves XML comments for language, grammar, consistency and correctness.
  • Adds see cref attributes for type references.
  • Removes unnecessary whitespace in XML comments.
  • Fixes typos ('pais' -> 'pairs').
  • Updates System.Object references to use simpler 'object' syntax.

Contributes towards #17285.

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

* Enabled nullable reference types.
* Made ObjectForKey return nullable TValue? since keys may not exist.
* Made TryGetValue parameter nullable with NotNullWhen(true) attribute.
* Kept IDictionary interface implementations non-nullable per .NET contract.
* Replaces 'To be added' XML comments with proper documentation.
* Verifies and improves XML comments for language, grammar, consistency and correctness.
* Adds see cref attributes for type references.
* Removes unnecessary whitespace in XML comments.
* Fixes typos ('pais' -> 'pairs').
* Updates System.Object references to use simpler 'object' syntax.

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 and significantly improves its XML documentation as part of the ongoing effort to add nullability to Foundation types (issue #17285).

Key changes:

  • Enabled nullable reference types throughout the file by adding #nullable enable at the top
  • Made ObjectForKey return NSObject? to reflect that keys may not exist in the dictionary
  • Updated TryGetValue to use [NotNullWhen(true)] attribute for better nullable semantics
  • Replaced placeholder "To be added" XML comments with comprehensive, accurate documentation
  • Fixed typo "pais" → "pairs" in documentation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Foundation/NSDictionary.cs Enables nullable reference types, improves TryGetValue nullability semantics with NotNullWhen attribute, replaces placeholder documentation with detailed XML comments, fixes spelling errors, and adds proper see cref attributes for type references
src/VideoToolbox/VTVideoEncoder.cs Updates TryGetValue call to use explicit type parameter syntax compatible with the new generic method signature

return TryGetValue<NSObject> (key, out value);
}

#nullable enable
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This #nullable enable directive is redundant since nullable reference types are already enabled at the file level (line 28). Consider removing this line.

Suggested change
#nullable enable

Copilot uses AI. Check for mistakes.
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #11cb476] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #11cb476] Build passed (Build packages) ✅

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

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #11cb476] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #11cb476] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 118 tests passed.

Failures

❌ monotouch tests (iOS) [attempt 2]

1 tests failed, 10 tests passed.

Failed tests

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

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 2] 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. [attempt 2] 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 (MacCatalyst): All 11 tests passed. 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. [attempt 2] 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: 11cb476e041a10e4df81edaed7bd4ae7fc08b868 [PR build]

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