Skip to content

'RegisterSymbolAction' for 'Property' doesn't run at all on partial properties with attributes on both definition and implementation parts #76166

@Sergio0694

Description

@Sergio0694

Version Used: 4.12.0-3.24558.5 (21192bf)

Steps to Reproduce:

  1. Clone https://github.com/CommunityToolkit/dotnet
  2. Checkout dev/more-analyzers (or Add more analyzers, enable unit tests for partial properties CommunityToolkit/dotnet#1010)
  3. Remove the [Ignore] from InvalidPartialPropertyLevelObservablePropertyAttributeAnalyzer_OnImplementedProperty_GeneratedByAnotherGenerator_Warns
  4. Put a breakpoint in the RegisterSymbolAction callback in InvalidPartialPropertyLevelObservablePropertyAttributeAnalyzer
  5. Run the test
  6. Verify that the callback is never executed
  7. Comment out the [GeneratedCode] attribute on the partial property implementation in that test
  8. Run the test again
  9. Verify the callback is now hit (??!)

Expected Behavior:

The RegisterSymbolAction callback should work as expected in both cases.

Actual Behavior:

The RegisterSymbolAction callback is apparently not called at all if you leave the attribute on the implementation part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-AnalyzersuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions