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

Delete unreachable default clause. #1547

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

stereotype441
Copy link
Member

The Dart analyzer will soon be changed so that if the default clause of a switch statement is determined to be unreachable by the exhaustiveness checker, a new warning of type
unreachable_switch_default will be issued. This parallels the behavior of the existing unreachable_switch_case warning, which is issued whenever a case clause of a switch statement is determined to be unreachable. For details see dart-lang/sdk#54575.

This PR deletes an unreachable default clause from dart_style now, to avoid a spurious warning when the analyzer change lands.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

The Dart analyzer will soon be changed so that if the `default` clause
of a `switch` statement is determined to be unreachable by the
exhaustiveness checker, a new warning of type
`unreachable_switch_default` will be issued. This parallels the
behavior of the existing `unreachable_switch_case` warning, which is
issued whenever a `case` clause of a `switch` statement is determined
to be unreachable.

This PR deletes an unreachable `default` clause from `dart_style` now,
to avoid a spurious warning when the analyzer change lands.
@stereotype441 stereotype441 merged commit 494a1d7 into dart-lang:main Aug 27, 2024
7 checks passed
@stereotype441 stereotype441 deleted the b_54575_24 branch August 27, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants