Skip to content

Trim analyzer should warn about assignment to get-only property #93277

@sbomer

Description

@sbomer

Opening this to track the follow-up items discussed in dotnet/linker#2728 - see that PR for full context.

The analyzer doesn't produce any warnings when assigning to a get-only property, because it doesn't know about the compiler-generated backing field. To fix this we could either:

  • continue using the same warning message, but with the property name instead of the compiler-generated field name that the linker see, or
  • reword the message to avoid mentioning "field" specifically, so it can be used for both the linker and analyzer.

Metadata

Metadata

Assignees

Labels

area-Tools-ILLink.NET linker development as well as trimming analyzersin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions