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

Convert to switch expression produces wrong code #48829

Open
ryzngard opened this issue Oct 21, 2020 · 11 comments
Open

Convert to switch expression produces wrong code #48829

ryzngard opened this issue Oct 21, 2020 · 11 comments
Assignees
Milestone

Comments

@ryzngard
Copy link
Contributor

Conversion is dropping all but the first case statement.

image

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Oct 21, 2020
@Youssef1313
Copy link
Member

This was claimed to be fixed by #46873 per #48006 (comment)

@ryzngard
Copy link
Contributor Author

@sharwell I was using Version 16.9.0 Preview 2.0 [30620.297.main] when I took this screenshot.

@sharwell
Copy link
Member

@ryzngard what version of the code style analyzers are installed in the project?

@ryzngard
Copy link
Contributor Author

3.8.0-2.20414.4

@jinujoseph jinujoseph added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 27, 2020
@jinujoseph jinujoseph added this to the 16.9 milestone Oct 27, 2020
@333fred
Copy link
Member

333fred commented Oct 30, 2020

@jinujoseph I think we need to up the priority of this. I'm seeing in 16.8p6.

@CyrusNajmabadi
Copy link
Member

It's a bug. I don't see the priority needing changing here for a refactoring doing the wrong thing.

@333fred
Copy link
Member

333fred commented Oct 30, 2020

IMO, this is the type of bug I would take for a servicing bar check. It's the type of thing that reduces faith in our refactorings, meaning people are less likely to use them, and it's likely a common refactoring that people would want to use, particularly as they start exploring C# 9 and or patterns.

@CyrusNajmabadi
Copy link
Member

IMO, this is the type of bug I would take for a servicing bar check.

We would not. We've shipped far worse bugs in refactorings all the time.

It's the type of thing that reduces faith in our refactorings,

Faith in refactoring does not meet the servicing bar. The servicing bar is extremely critical issue blocking work. This is an optional feature that doesn't do the right thing here. It's not the first, nor last time we've had that. And it definitely does not meet any divisional servicing bars.

@CyrusNajmabadi
Copy link
Member

Very weird. I can repro this in hte prodct, but ont in a small repro. Not certain what's going on here.

@CyrusNajmabadi
Copy link
Member

Trying this out in a roslyn hive i get:

image

But i'm on latest master. So something very strange is happening here...

@CyrusNajmabadi
Copy link
Member

Opening up roslyn in roslyn to see what's up here...

@jinujoseph jinujoseph modified the milestones: 16.9, 16.10 Mar 28, 2021
@jinujoseph jinujoseph modified the milestones: 16.10, Backlog Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants