Skip to content

Commit 5f30c56

Browse files
[dwds] Delete unreachable default clauses. (#2484)
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.
1 parent 8156106 commit 5f30c56

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

dwds/lib/src/debugging/instance.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ class InstanceHelper extends Domain {
170170
case RuntimeObjectKind.object:
171171
case RuntimeObjectKind.nativeError:
172172
case RuntimeObjectKind.nativeObject:
173-
default:
174173
return await _plainInstanceFor(
175174
metaData,
176175
remoteObject,

dwds/lib/src/servers/extension_debugger.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ class ExtensionDebugger implements RemoteDebugger {
364364
return 'none';
365365
case PauseState.uncaught:
366366
return 'uncaught';
367-
default:
368-
throw ArgumentError('unknown state: $state');
369367
}
370368
}
371369

0 commit comments

Comments
 (0)