[ObjCRuntime] Enable nullability and clean up TrampolineBlockBase.#24741
[ObjCRuntime] Enable nullability and clean up TrampolineBlockBase.#24741rolfbjarne wants to merge 1 commit intomainfrom
Conversation
This is file 5 of 7 files with nullability disabled in ObjCRuntime. * Enable nullability (#nullable enable). * Add nullability annotations and validation for block pointers and managed delegate retrieval. * Add missing XML documentation for the public type and protected members. * Fix wording typo in infrastructure comment. Contributes towards #17285. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR enables nullability annotations for the TrampolineBlockBase class in ObjCRuntime, addressing file 5 of 7 in issue #17285. The changes add comprehensive XML documentation for the public type and protected members, introduce nullability checking for block pointer validation, and update call sites to properly handle nullable return types. A typo in an infrastructure comment is also corrected.
Changes:
- Enabled
#nullable enablefor TrampolineBlockBase.cs - Added XML documentation for public/protected members of TrampolineBlockBase
- Updated GetExistingManagedDelegate to add null checking and return nullable types
- Updated call sites to handle nullable delegate returns with explicit nullable casts
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cecil-tests/Documentation.KnownFailures.txt | Removes documentation failures for now-documented TrampolineBlockBase members |
| src/bgen/Generator.cs | Updates generated code to cast GetExistingManagedDelegate result as nullable |
| src/UIKit/UIConfigurationColorTransformer.cs | Adds nullable cast for GetExistingManagedDelegate return value |
| src/UIKit/UICellAccessory.cs | Adds nullable cast for GetExistingManagedDelegate return value |
| src/ObjCRuntime/TrampolineBlockBase.cs | Enables nullability, adds XML docs, fixes typo, and adds null checking to GetExistingManagedDelegate |
✅ [CI Build #524b04e] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #524b04e] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #524b04e] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #524b04e] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 155 tests passed. Failures❌ linker tests [attempt 2]1 tests failed, 43 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This is file 5 of 7 files with nullability disabled in ObjCRuntime.
Contributes towards #17285.