Skip to content

Conversation

@rolfbjarne
Copy link
Member

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

  • Enables nullability.
  • Removes SupportedOSPlatform attributes without version numbers from NSObject and NSObservedChange classes.
  • Replaces XML include attributes with inlined content from NSObjectFlag.xml and NSObservedChange.xml.
  • Removes 'To be added' XML comments with proper documentation.
  • Adds missing XML documentation for public and protected members.
  • Improves XML comments for language, grammar, consistency and correctness.
  • Adds see cref attributes for type and member references.
  • Removes unnecessary whitespace in XML comments.

Contributes towards #17285.

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

* Enables nullability.
* Removes SupportedOSPlatform attributes without version numbers from NSObject and NSObservedChange classes.
* Replaces XML include attributes with inlined content from NSObjectFlag.xml and NSObservedChange.xml.
* Removes 'To be added' XML comments with proper documentation.
* Adds missing XML documentation for public and protected members.
* Improves XML comments for language, grammar, consistency and correctness.
* Adds see cref attributes for type and member references.
* Removes unnecessary whitespace in XML comments.

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 the NSObject class in Foundation, which is a critical component of the .NET for iOS/Mac/tvOS bindings. The changes ensure proper null safety throughout the Foundation framework by fixing nullability annotations and improving documentation quality.

  • Enables #nullable enable in NSObject2.cs and removes redundant #nullable directives throughout the file
  • Updates method signatures to properly reflect nullable return types (e.g., ToString() now returns string?)
  • Improves XML documentation by inlining content from external XML files and replacing "To be added" placeholders with detailed descriptions

Reviewed changes

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

Show a summary per file
File Description
src/Foundation/NSObject2.cs Enables nullability, inlines XML documentation from external files, adds comprehensive documentation for NSObjectFlag and NSObservedChange classes, and updates method signatures with proper nullable annotations
src/Foundation/NSUrlRequest.cs Updates ToString() return type to nullable string? to match base class nullability
src/Foundation/NSUrl.cs Updates ToString() return type to nullable string? to match base class nullability
src/Foundation/NSString.cs Adds null-forgiving operator for NSObject.FromObject() call since the result is guaranteed non-null for non-null input
src/Foundation/NSSet.cs Updates Contains() to accept nullable parameters and handle null inputs correctly
src/Foundation/NSOrderedSet.cs Updates Contains() to accept nullable parameters and handle null inputs correctly
src/Foundation/NSAction.cs Updates internal dispatcher classes to accept nullable state parameters
src/Foundation/DictionaryContainer.cs Adds null-forgiving operator for NSObject.FromObject() call in array conversion
src/CoreImage/CIDetectorOptions.cs Adds null-forgiving operators for NSObject.FromObject() calls with value types that cannot be null
src/CoreFoundation/CFException.cs Adds null-coalescing operators to handle nullable ToString() results when populating exception data
src/CoreBluetooth/CBUUID.cs Updates Equals() parameter to accept nullable object?
src/AppKit/NSColor.cs Updates ToString() return type to nullable string? to match base class nullability
docs/api/Foundation/NSObservedChange.xml Removed - content inlined into NSObject2.cs
docs/api/Foundation/NSObjectFlag.xml Removed - content inlined into NSObject2.cs
tests/cecil-tests/Documentation.KnownFailures.txt Removes SetValueForKeyPath(NativeHandle, NSString) from known failures list as it now has proper documentation

@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

✅ [CI Build #b257485] Build passed (Build packages) ✅

Pipeline on Agent
Hash: b257485a3e359d2e313723b1327e46a62cb11f86 [PR build]

@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

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #b257485] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: b257485a3e359d2e313723b1327e46a62cb11f86 [PR build]

@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

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) January 6, 2026 07:58
@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 #b257485] Build passed (Detect API changes) ✅

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

@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

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

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

Pipeline on Agent
Hash: b257485a3e359d2e313723b1327e46a62cb11f86 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #b257485] 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. [attempt 2] 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. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. 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. 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: b257485a3e359d2e313723b1327e46a62cb11f86 [PR build]

@rolfbjarne rolfbjarne merged commit 6ee9375 into main Jan 8, 2026
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