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

Correct implementation identity for MBM and .NET compatibility #1729

Merged
merged 7 commits into from
May 4, 2022

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented May 3, 2022

Registration-free metadata based marshaling (MBM) always queries for IInspectable, so the implementation of GetRuntimeClassName from this IInspectable implementation must return the class or interface type best describing the implementation. This change also ensures that the .NET interop support will be able to correctly resolve the type of a given Rust implementation.

The identity is assumed to be the first interface or class declared by the implement macro. Previously, it returned an empty string if you explicitly query for IInspectable and then call GetRuntimeClassName since it doesn't know which interface you're specifically asking about.

Original repro is here: https://github.com/kennykerr/component-rs

Fixes #1730

@kennykerr

This comment was marked as outdated.

@kennykerr kennykerr changed the title Correct implementation identity for .NET compatibility Correct implementation identity for MBM and .NET compatibility May 3, 2022
@kennykerr kennykerr reopened this May 3, 2022
@kennykerr kennykerr requested a review from manodasanW May 3, 2022 21:21
@kennykerr kennykerr merged commit 37ccd01 into master May 4, 2022
@kennykerr kennykerr deleted the identity branch May 4, 2022 02:38
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.

Implementations must return GetRuntimeClassName to satisfy MBM and .NET
1 participant