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 IL2091 warnings in generated activation factories #1449

Merged

Conversation

Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented Jan 17, 2024

This fixes the following error in authoring scenarios:

"WinRT.SourceGenerator\Generator.SourceGenerator\MinimalWinRTComponentTest.cs(84,20): warning IL2091: 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicConstructors', 'DynamicallyAccessedMemberTypes.PublicFields' in 'WinRT.IObjectReference.As<T>()'. The generic parameter 'I' of 'ABI.Impl.MinimalWinRTComponentTest.HelloWorldEffectServerActivationFactory.ActivateInstance<I>()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to."

The method is unused, but at least this will fix the warning and make it trim-safe in case anyone actually needs it.

@Sergio0694 Sergio0694 added authoring Related to authoring feature work trimming labels Jan 17, 2024
@Sergio0694 Sergio0694 requested a review from manodasanW January 17, 2024 22:35
@Sergio0694 Sergio0694 merged commit aff0c34 into staging/AOT Jan 19, 2024
9 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/fix-activateinstance-IL2091 branch January 19, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Related to authoring feature work trimming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants