Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactoring ""Extract Method" when a primary constructor property is in the extracted code sends primary constructor property in as a method parameter #73580

Open
vsfeedback opened this issue May 20, 2024 · 1 comment
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


If you do the "Extract method" refactoring on a block of code that contains a primary constructor parameter (new in C#12), the extraction succeeds, but the primary constructor is passed in as a method parameter into the new method. The extract method refactoring should not pass this variable in, but instead, reference it from inside of the new method directly.
Untitled.png


Original Comments

Feedback Bot on 5/16/2024, 00:55 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 20, 2024
@TahirAhmadov
Copy link

I can confirm, this is an issue for me, too, version 17.9.2.

@CyrusNajmabadi CyrusNajmabadi added help wanted The issue is "up for grabs" - add a comment if you are interested in working on it Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 4, 2024
@CyrusNajmabadi CyrusNajmabadi added this to InQueue in Small Fixes via automation Jun 4, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Small Fixes
  
InQueue
Development

No branches or pull requests

3 participants