Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Sep 22, 2023

Previously, the analyzer was effectively visiting referenced properties twice for each reference - it would visit both the referenced get/set method, and the property itself.

This change only visits the get/set method, and handles the property warnings there by treating the getter/setter as annotated when the property is annotated. This also allows some simplification of the override checking logic. Events get the same treatment.

Fixes #83235

Previously this was effectively visiting referenced properties twice for each reference - it would visit both the referenced get/set method, and the property itself.

This change only visits the get/set method, and handles the property warnings there by treating the getter/setter as annotated when the property is annotated.

This also allows some simplification of the override checking logic.
Equivalent warnings are now reported on the get/set methods.
@sbomer sbomer requested a review from vitek-karas September 22, 2023 00:00
@sbomer sbomer requested a review from marek-safar as a code owner September 22, 2023 00:00
@ghost ghost added linkable-framework Issues associated with delivering a linker friendly framework area-Tools-ILLink .NET linker development as well as trimming analyzers labels Sep 22, 2023
@ghost ghost assigned sbomer Sep 22, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

Previously, the analyzer was effectively visiting referenced properties twice for each reference - it would visit both the referenced get/set method, and the property itself.

This change only visits the get/set method, and handles the property warnings there by treating the getter/setter as annotated when the property is annotated. This also allows some simplification of the override checking logic. Events get the same treatment.

Fixes #83235

Author: sbomer
Assignees: -
Labels:

linkable-framework, area-Tools-ILLink

Milestone: -

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sbomer sbomer merged commit 3eba4e0 into dotnet:main Sep 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 22, 2023
@sbomer sbomer deleted the propertyFix branch November 3, 2023 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ILLink analyzer handling of IL3003 on properties and events

2 participants