Skip to content

Trim analyzer C# 14 support #117065

Open
Open
@jtschuster

Description

@jtschuster

The trim analyzer hasn't been tested with new C# 14 features to make sure it doesn't crash, report incorrect warnings, or miss warnings.

One issue is the analyzer doesn't recognize the 'field' keyword, and gives it UnknownValue for a dataflow value, resulting in a warning for the following code:

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)]
static Type MyType { get => field; } // Value returned from method 'MyType.get' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.

https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions