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

[analysis_server] convert_to_if_case_statement_chain assist deletes switch with empty body #54077

Closed
parlough opened this issue Nov 17, 2023 · 1 comment
Assignees
Labels
analyzer-assist Issues with analysis server assists analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@parlough
Copy link
Member

void main() {
  switch (3) {}
}

If you try a quick fix on switch, it will offer to apply convert_to_if_case_statement_chain, which removes the switch. Technically it doesn't change the behavior in this situation, but I'd rather this not be offered even in that case. If the expression being matched does have side effects though, the quick fix will change behavior.

@parlough parlough added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Nov 17, 2023
@parlough parlough self-assigned this Nov 17, 2023
@parlough parlough added analyzer-server analyzer-assist Issues with analysis server assists labels Nov 17, 2023
@bwilkerson
Copy link
Member

I agree. The assist isn't useful if there are no cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-assist Issues with analysis server assists analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

2 participants