Skip to content

Commit 494a1d7

Browse files
Delete unreachable default clause. (#1547)
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.
1 parent 58e96a9 commit 494a1d7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/src/front_end/piece_factory.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,6 @@ mixin PieceFactory {
837837
tokenPiece(combinatorNode.keyword),
838838
for (var name in names) tokenPiece(name.token, commaAfter: true),
839839
]));
840-
default:
841-
throw StateError('Unknown combinator type $combinatorNode.');
842840
}
843841
}
844842

0 commit comments

Comments
 (0)