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

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

Issue 2158913003: Flatten the if-else sequence. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 6c8bcb0267bc97368cac43151c4837ad22b0bc78..6c2cd976e23090d0467a22737eb802cc54782714 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -1100,26 +1100,23 @@ class ElementResolver extends SimpleAstVisitor<Object> {
if (_isConstructorReturnType(node)) {
_resolver.errorReporter.reportErrorForNode(
CompileTimeErrorCode.INVALID_CONSTRUCTOR_NAME, node);
+ } else if (parent is Annotation) {
+ _resolver.errorReporter.reportErrorForNode(
+ CompileTimeErrorCode.INVALID_ANNOTATION, parent);
+ } else if (element != null) {
+ _resolver.errorReporter.reportErrorForNode(
+ CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
+ node,
+ [element.name]);
+ } else if (node.name == "await" && _resolver.enclosingFunction != null) {
+ _recordUndefinedNode(
+ _resolver.enclosingClass,
+ StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT,
+ node,
+ [_resolver.enclosingFunction.displayName]);
} else {
- if (parent is Annotation) {
- _resolver.errorReporter.reportErrorForNode(
- CompileTimeErrorCode.INVALID_ANNOTATION, parent);
- } else if (element != null) {
- _resolver.errorReporter.reportErrorForNode(
- CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
- node,
- [element.name]);
- } else {
- if (node.name == "await" && _resolver.enclosingFunction != null) {
- _recordUndefinedNode(_resolver.enclosingClass,
- StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT,
- node,
- [_resolver.enclosingFunction.displayName]);
- } else {
- _recordUndefinedNode(_resolver.enclosingClass,
- StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
- }
- }
+ _recordUndefinedNode(_resolver.enclosingClass,
+ StaticWarningCode.UNDEFINED_IDENTIFIER, node, [node.name]);
}
}
node.staticElement = element;
« 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