| Index: pkg/compiler/lib/src/resolution/members.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
|
| index e5f3477e38d8f85eb02396c7d4cb2c4836a827e9..9fb5495a263d791b6bbe0190fd8af48b046d14ed 100644
|
| --- a/pkg/compiler/lib/src/resolution/members.dart
|
| +++ b/pkg/compiler/lib/src/resolution/members.dart
|
| @@ -4602,6 +4602,15 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
|
| reporter.reportErrorMessage(
|
| switchCase, MessageKind.INVALID_CASE_DEFAULT);
|
| }
|
| + if (cases.isNotEmpty) {
|
| + Node last = switchCase.statements.last;
|
| + if (last.asBreakStatement() == null &&
|
| + last.asContinueStatement() == null &&
|
| + last.asThrow() == null &&
|
| + last.asReturn() == null) {
|
| + registry.registerFeature(Feature.FALL_THROUGH_ERROR);
|
| + }
|
| + }
|
| }
|
|
|
| addDeferredAction(enclosingElement, () {
|
| @@ -4623,7 +4632,6 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
|
| });
|
| // TODO(15575): We should warn if we can detect a fall through
|
| // error.
|
| - registry.registerFeature(Feature.FALL_THROUGH_ERROR);
|
| return const NoneResult();
|
| }
|
|
|
|
|