Skip to content

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

2 participants