Skip to content

[runtime] Use method_getTypeEncoding instead of the deprecated method_getDescription - #25686

Merged
dalexsoto merged 2 commits into
mainfrom
dev/alex/trampoline
Jun 16, 2026
Merged

[runtime] Use method_getTypeEncoding instead of the deprecated method_getDescription#25686
dalexsoto merged 2 commits into
mainfrom
dev/alex/trampoline

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

get_method_description () read a method's Objective-C type-encoding string via method_getDescription (method)->types. method_getDescription is deprecated: the <objc/runtime.h> annotation reads "first deprecated in macOS 11.0 - Use method_getName and method_getTypeEncoding". Since the only field we ever consumed was 'types', method_getTypeEncoding returns exactly that same string and is the non-deprecated, future-proof replacement.

Standalone backport of the runtime/trampolines.m change from the Xcode 27 update (dotnet/macios #25665, commit 0dc3ce9), as suggested in code review; it is independent of the Xcode 27 bump itself.

…_getDescription

get_method_description () read a method's Objective-C type-encoding string via
method_getDescription (method)->types. method_getDescription is deprecated: the
<objc/runtime.h> annotation reads "first deprecated in macOS 11.0 - Use
method_getName and method_getTypeEncoding". Since the only field we ever consumed
was 'types', method_getTypeEncoding returns exactly that same string and is the
non-deprecated, future-proof replacement.

Standalone backport of the runtime/trampolines.m change from the Xcode 27 update
(dotnet/macios #25665, commit 0dc3ce9), as suggested in code review; it is
independent of the Xcode 27 bump itself.

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

Copy link
Copy Markdown
Member Author

/azp run

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 updates the runtime trampoline helper that retrieves an Objective-C method’s type encoding to avoid using the deprecated method_getDescription, replacing it with method_getTypeEncoding as recommended by <objc/runtime.h>.

Changes:

  • Replace method_getDescription (method)->types with method_getTypeEncoding (method) in get_method_description.
  • Add an in-code comment explaining the deprecation and why the replacement is equivalent for this use case.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

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

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #7758b71] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 7758b71f81fd3681726c2f22f8c3620941b6cd32 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #7758b71] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 7758b71f81fd3681726c2f22f8c3620941b6cd32 [PR build]

@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: 7758b71f81fd3681726c2f22f8c3620941b6cd32 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #7758b71] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 7758b71f81fd3681726c2f22f8c3620941b6cd32 [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
Copy Markdown
Collaborator

🔥 [CI Build #7758b71] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

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

Failures

❌ introspection tests [attempt 3]

1 tests failed, 5 tests passed.

Failed tests

  • introspection/macOS/Debug: Failed (Test run failed.
    Tests run: 34 Passed: 33 Inconclusive: 0 Failed: 1 Ignored: 0)

Html Report (VSDrops) Download

Successes

✅ 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
✅ linker (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 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: 7758b71f81fd3681726c2f22f8c3620941b6cd32 [PR build]

@dalexsoto

Copy link
Copy Markdown
Member Author

Just the unrelated intro failure
image

@dalexsoto
dalexsoto merged commit c18e1f7 into main Jun 16, 2026
54 of 56 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/trampoline branch June 16, 2026 01:40
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