Closed
Description
Description
We're in the process of fixing all trim/AOT warnings in CsWinRT, and as of our latest PR we're now down to 0 warnings when building. However, we still get 4 warnings from ILC at publish time. I figured I'd report them in case they're actual trim bugs. Annotations in code seem correct.
Reproduction Steps
Use this test project: MinimalWinRTComponentTest.zip.
The code for CsWinRT we're working on is here: https://github.com/microsoft/CsWinRT/tree/staging/AOT.
Expected behavior
No ILC warnings.
Actual behavior
ILC : Trim analysis warning IL2068: WinRT.Projections.FindCustomHelperTypeMapping(Type,Boolean): 'WinRT.Projections.FindCustomHelperTypeMapping(Type,Boolean)' method return value does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields' requirements. The parameter '#ILLink.Shared.TypeSystemProxy.ParameterIndex' of method 'System.Collections.Generic.Dictionary`2<Type,Type>.TryGetValue(Type,Type&)' 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. [D:\source\MinimalWinRTComponentTest\MinimalWinRTComponentTest\MinimalWinRTComponentTest.csproj]
ILC : Trim analysis warning IL2087: WinRT.ObjectReferenceWithContext`1.<GetCurrentContext>g__CreateForCurrentContext|19_0(IntPtr): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'WinRT.GuidGenerator.GetIID(Type)'. The generic parameter 'T' of 'WinRT.ObjectReferenceWithContext`1' 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. [D:\source\MinimalWinRTComponentTest\MinimalWinRTComponentTest\MinimalWinRTComponentTest.csproj]
ILC : Trim analysis warning IL2055: WinRT.TypeNameSupport.<FindTypeByNameCore>g__ResolveGenericType|9_0(Type,Type[],String): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. [D:\source\MinimalWinRTComponentTest\MinimalWinRTComponentTest\MinimalWinRTComponentTest.csproj]
ILC : Trim analysis warning IL2067: WinRT.GuidGenerator.GetSignature(Type): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'WinRT.GuidGenerator.GetSignature(Type)'. The parameter 'defaultInterface' of method 'WinRT.Projections.TryGetDefaultInterfaceTypeForRuntimeClassType(Type,Type&)' 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. [D:\source\MinimalWinRTComponentTest\MinimalWinRTComponentTest\MinimalWinRTComponentTest.csproj]
Metadata
Metadata
Assignees
Type
Projects
Status
No status