Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 2392303002: Handle invalid default cases. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9fb5495a263d791b6bbe0190fd8af48b046d14ed..60cf6574a7b14946c1978f5380c2c45e6edfb6ab 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -4602,7 +4602,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
reporter.reportErrorMessage(
switchCase, MessageKind.INVALID_CASE_DEFAULT);
}
- if (cases.isNotEmpty) {
+ if (cases.isNotEmpty && switchCase.statements.isNotEmpty) {
Node last = switchCase.statements.last;
if (last.asBreakStatement() == null &&
last.asContinueStatement() == null &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698