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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 885283007: Fix for issue 22110 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 02781e4e70f4c8839152e05ebf97a94ac3b83b52..9f3ab6db8bc4e02b0522cb0702245e1e9c2fc947 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4202,6 +4202,18 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
return false;
}
}
+ // All of the members exit, determine whether there are possible cases
+ // that are not caught by the members.
+ DartType type = node.expression == null ? null : node.expression.bestType;
+ if (type is InterfaceType) {
+ ClassElement element = type.element;
+ if (element != null && element.isEnum) {
+ // If some of the enum values are not covered, then a warning will
+ // have already been generated, so there's no point in generating a
+ // hint.
+ return true;
+ }
+ }
return hasDefault;
} finally {
_enclosingBlockContainsBreak = outerBreakValue;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698