Skip to content

Commit

Permalink
[dwds] Delete unreachable default clauses. (#2484)
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. For details see
dart-lang/sdk#54575.

This PR deletes unreachable `default` clauses from `webdev/dwds` now,
to avoid a spurious warning when the analyzer change lands.
  • Loading branch information
stereotype441 authored Sep 4, 2024
1 parent 8156106 commit 5f30c56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion dwds/lib/src/debugging/instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class InstanceHelper extends Domain {
case RuntimeObjectKind.object:
case RuntimeObjectKind.nativeError:
case RuntimeObjectKind.nativeObject:
default:
return await _plainInstanceFor(
metaData,
remoteObject,
Expand Down
2 changes: 0 additions & 2 deletions dwds/lib/src/servers/extension_debugger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ class ExtensionDebugger implements RemoteDebugger {
return 'none';
case PauseState.uncaught:
return 'uncaught';
default:
throw ArgumentError('unknown state: $state');
}
}

Expand Down

0 comments on commit 5f30c56

Please sign in to comment.