Skip to content

Commit

Permalink
Delete unreachable default clause. (#1547)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stereotype441 authored Aug 27, 2024
1 parent 58e96a9 commit 494a1d7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/src/front_end/piece_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,6 @@ mixin PieceFactory {
tokenPiece(combinatorNode.keyword),
for (var name in names) tokenPiece(name.token, commaAfter: true),
]));
default:
throw StateError('Unknown combinator type $combinatorNode.');
}
}

Expand Down

0 comments on commit 494a1d7

Please sign in to comment.