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

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

Issue 2033693003: ExitDetector: Do not special case enums, since null exists (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 d5035ee362263b63590c759d013c12d177814893..26d1ed7c7ae351bd8858cdb08965edee5581de5d 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3807,18 +3807,7 @@ 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?.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;
- }
- }
+ // As all cases exit, return whether that list includes `default`.
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