-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzers
Milestone
Description
The analyzer has basic handling of IDynamicInvocationOperation, but not IDynamicMemberInvocation and related operation types. This support should be added and moved from the attribute-based analyzer into the dataflow analyzer.
For example, this produces no analyzer warnings:
static void Test(dynamic d) {
d.Member = 1;
}but ILLink produces a warning:
Trim analysis warning IL2026: Program.<<Main>$>g__Test|0_0(Object): Using member 'Microsoft.CSharp.RuntimeBinder.Binder.SetMember(CSharpBinderFlags, String, Type, IEnumerable<CSharpArgumentInfo>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Using dynamic types might cause types or members to be removed by trimmer.
Discovered in #94016.
Metadata
Metadata
Assignees
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzers
Type
Projects
Status
No status