Skip to content

Fix delegate conversion on analyzers#1964

Merged
tlakollo merged 4 commits intodotnet:mainfrom
tlakollo:FixAnalyzerDelegateConversion
Apr 24, 2021
Merged

Fix delegate conversion on analyzers#1964
tlakollo merged 4 commits intodotnet:mainfrom
tlakollo:FixAnalyzerDelegateConversion

Conversation

@tlakollo
Copy link
Contributor

Fix delegate conversion on analyzers
Add tests
Related to #1912

@tlakollo tlakollo requested review from agocke and mateoatr April 15, 2021 02:32
@tlakollo tlakollo requested a review from marek-safar as a code owner April 15, 2021 02:32
@tlakollo tlakollo self-assigned this Apr 15, 2021
CheckMethodOrCtorCall (operationContext, prop.SetMethod);
}, OperationKind.PropertyReference);

context.RegisterOperationAction (operationContext => {
Copy link
Member

Choose a reason for hiding this comment

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

This diff makes me think we need to share more between the two analyzers. They look like they're doing pretty much exactly the stuff.

return VerifyRequiresAssemblyFilesAnalyzer (src);
}

[Fact]
Copy link
Member

Choose a reason for hiding this comment

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

Same with the tests. Can we start to share stuff here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I open #1986 to track the refactoring work in a separate PR since I think it would have a lot of feedback.

Fix test
Add number of iterations to codefix
@tlakollo tlakollo requested a review from agocke April 22, 2021 00:24
Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

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

LGTM aside from small question about comment

@tlakollo tlakollo merged commit 7ddfe7b into dotnet:main Apr 24, 2021
@tlakollo tlakollo deleted the FixAnalyzerDelegateConversion branch April 24, 2021 01:07
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Fix delegate conversion on analyzers
Fix test in RequiresUnreferencedCodeAnalyzer
Add tests for delegate conversion
Add the ability to pass the number of iterations in a codefix

Commit migrated from dotnet/linker@7ddfe7b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants