Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not pass primary constructor parameters explicit when extracting methods #76179

Merged

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #73044
Fixes #73580

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 30, 2024 08:37
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 30, 2024
var primaryConstructorParameterReadOrWritten = dataFlowAnalysisData.ReadInside
.Concat(dataFlowAnalysisData.WrittenInside)
.OfType<IParameterSymbol>()
.FirstOrDefault(s => s.IsPrimaryConstructor(this.CancellationToken)) != null;
Copy link
Contributor

Choose a reason for hiding this comment

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

FirstOrDefault

.Any ?

Copy link
Member Author

Choose a reason for hiding this comment

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

now i want to write an analyzer/fixer that finds this pattern and suggests changing it.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit bd11ad7 into dotnet:main Dec 3, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the extractMethodPrimaryConstructor branch December 3, 2024 00:07
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 3, 2024
@dibarbet dibarbet modified the milestones: Next, 17.13 P3 Jan 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
3 participants