Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0.1xx-xcode15.4] [dotnet-linker] Fix computing block signatures. Fixes #21008. #21044

Conversation

vs-mobiletools-engineering-service2
Copy link
Collaborator

When we compute the signature of a block for Objective-C, we need to use parameters of the user-provided callback (and not the intermediate UnmanagedCallersOnly method) to compute the signature.

This is because the intermediate method's parameters don't have all the information we need to correctly compute the block signature (in particular for the issue in question, the user callback has an NSError parameter, while the intermediate method has an IntPtr parameter, and these two parameter types show up differently in the block signature).

This is solved by adding the UserDelegateType attribute (which was created for exactly this, and it's just in older generated code) to the intermediate method, pointing to a delegate with the correct managed signature.

Fixes #21008.

Backport of #21011

@dalexsoto
Copy link
Member

@rolfbjarne we can’t use backport bot since it will create the pr from a fork 😕

@rolfbjarne
Copy link
Member

@rolfbjarne we can’t use backport bot since it will create the pr from a fork 😕

🤦 : #21048

@rolfbjarne rolfbjarne closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants