You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticvoidMain(){M(typeof(C));}// warning IL2082: 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'C.M(Type)'.// The implicit 'this' argument of method 'C.Main()' 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.privatestaticvoidM([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]Typetype){}
@mateoatr I think the typeof case here is causing the extra warning:
I think the intention was to support typeof(T) flowing into an annotated location where T references a generic parameter. Unfortunately it produces unexpected warnings in cases like the above. Discovered while adding shared tests as part of #2307.
The text was updated successfully, but these errors were encountered:
We will want to track both typeof(Foo) where Foo is a known type, and typeof(T) where T is a generic parameter. However, since we don't have the binding logic that produces warnings for typeof(Foo) values yet, I think it would be acceptable not to track typeof(Foo) for now. In that case I think this particular issue could be fixed by only returning typeOf.TypeOperand when the type operand in the typeof operation is an ITypeParameterSymbol.
@mateoatr I think the typeof case here is causing the extra warning:
linker/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs
Line 216 in 83c51d4
I think the intention was to support typeof(T) flowing into an annotated location where T references a generic parameter. Unfortunately it produces unexpected warnings in cases like the above. Discovered while adding shared tests as part of #2307.
The text was updated successfully, but these errors were encountered: