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

C# Extract Method refactoring failed if "Not all code paths return" #65496

Open
wmjordan opened this issue Nov 18, 2022 · 0 comments · May be fixed by #76549
Open

C# Extract Method refactoring failed if "Not all code paths return" #65496

wmjordan opened this issue Nov 18, 2022 · 0 comments · May be fixed by #76549
Assignees
Labels
Milestone

Comments

@wmjordan
Copy link

wmjordan commented Nov 18, 2022

Version Used:
VS 17.3 or later (up to 17.5 preview 6)

I have posted an issue in VS feedback before, but no reply except asking me for reproducing steps.

Steps to Reproduce:

  1. A C# file with the following code.
  2. Select if (a == 1) { return "err"; }
  3. Execute the Extract Method command.
  4. Press Yes in the prompt dialog.
  5. Nothing happened
using System;

public class Class1
{
	public string M()
	{
		var a = 1;
		if (a == 1) {
			return "err";
		}
		if (a == 2) {
			return "ok";
		}
	}
}

Expected Behavior:
In previous versions, if we pressed Yes in the prompt dialog, the refactor continued and we could manually deal with the broken code.

Actual Behavior:
No matter we press Yes to continue or No to cancel, nothing is changed.

@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 18, 2022
@jasonmalinowski jasonmalinowski added this to the 17.5 milestone Nov 18, 2022
@jasonmalinowski jasonmalinowski removed the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 18, 2022
@arunchndr arunchndr modified the milestones: 17.5, Backlog Sep 12, 2023
@CyrusNajmabadi CyrusNajmabadi assigned Cosifne and unassigned ryzngard Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants