-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-Tools-ILLink.NET linker development as well as trimming analyzers.NET linker development as well as trimming analyzers
Milestone
Description
The ILLink Roslyn analyzer doesn't properly handle operator methods. It doesn't see annotated operator method parameters, and instead treats operator method returns as unknown values:
Repro:
var result = new OperatorType() - new OperatorType();
result.RequiresPublicMethods(); // Should report IL2072 about mismatch. Instead reports IL2062 (unknown value passed to RequiresPublicMethods).
private sealed class OperatorType : TestSystemTypeBase
{
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)]
public static Type operator -(OperatorType left, OperatorType right) => ...
}
Annotated operator parameters are similar. This is a very niche scenario since it requires defining operators for annotatable types (System.Type for example).
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