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

Fix scenario where generic implementation type doesn't have type factory intialized #1693

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

manodasanW
Copy link
Member

Fixing the scenario where the implementation type of an RCW we are creating is not the same as the statically declared type and it is a generic type whose RCW factory hasn't been initialized by the projection for another scenario.

For instance, lets say we are returning a list in the implementation but we declared on the API surface as an IEnumerable<object>. In this case, runtime class name would report it is a IList<object> but the RCW factory for it would not have been registered by the projection given it only knows IEnumerable<object> and registered that one. We now detect such scenarios and fallback best effort to the statically known type's RCW factory which should be initialized. If a user wants to cast after to the actual implementation type, they can still manually register the RCW factory to get it properly constructed.

Fixes the issue referenced in this comment: #1623 (comment)

@manodasanW manodasanW merged commit 15af469 into staging/AOT Aug 2, 2024
10 checks passed
@manodasanW manodasanW deleted the manodasanw/generictypefactory branch August 2, 2024 05:35
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.

1 participant