Skip to content

[src] Correct NSApplication nullability Fixes #26449 - #26464

Open
rolfbjarne wants to merge 5 commits into
mainfrom
dev/rolf/appkit-null-bindings
Open

[src] Correct NSApplication nullability Fixes #26449#26464
rolfbjarne wants to merge 5 commits into
mainfrom
dev/rolf/appkit-null-bindings

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Add the missing [NullAllowed] annotations to NSApplication members whose AppKit declarations accept nullable values or return nullable objects.

Remove the corresponding resolved xtro-sharpie ignores.

Fixes #26449
🤖 Pull request created by Copilot

rolfbjarne and others added 3 commits August 24, 2026 22:05
Fixes #26449

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fixes #26449

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 20:15
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner August 24, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts the AppKit binding definitions to correctly model nullable AppKit APIs (primarily on NSApplication and NSDockTile) by adding [NullAllowed] / [return: NullAllowed] annotations, and removes the corresponding resolved xtro-sharpie ignore entries.

Changes:

  • Add [NullAllowed] / [return: NullAllowed] annotations to NSApplication members whose AppKit counterparts accept/return nil.
  • Allow null assignment for NSApplication.ApplicationIconImage and NSDockTile.ContentView via updated binding nullability.
  • Remove now-resolved !missing-null-allowed! entries from the macOS AppKit xtro ignore file.

Reviewed changes

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

File Description
src/appkit.cs Adds missing nullability annotations to AppKit bindings (including the reported ApplicationIconImage / NSDockTile.ContentView null setters).
tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore Removes xtro-sharpie ignore entries that should be resolved by the updated binding nullability.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/appkit.cs
Comment thread src/appkit.cs
@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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 919b9b34-af19-4e7d-8b96-102dfa9be80f
@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.

CS0657: 'return' is not a valid attribute location for a property; use [NullAllowed] instead of [return: NullAllowed] on MainWindow, KeyWindow, ModalWindow, and CurrentEvent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 919b9b34-af19-4e7d-8b96-102dfa9be80f
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
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: 901c3ab03c41659d940776570f8d108f28ca9ac4 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #901c3ab] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

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

Failures

❌ monotouch tests (tvOS)

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

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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 (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 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

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 901c3ab03c41659d940776570f8d108f28ca9ac4 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AppKit] ApplicationIconImage and NSDockTile.ContentView reject valid null values

3 participants