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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 2605583002: Fix warnings in pkg/analyzer caused by be6a822daff2fae75a480d7da656ab0d9c86512e (Closed)
Patch Set: Created 4 years 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/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index 8ac2c16df693767f4f30d52b213241b5ed254bae..4b9857d26245b8ce8330b8182f061e109cfe61ac 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -2339,8 +2339,10 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
}
} else if (node.operator.type == TokenType.PLUS) {
// numeric or {@code null}
- if ((leftOperand is num && rightOperand is num) ||
- (leftOperand is String && rightOperand is String)) {
+ if (leftOperand is num && rightOperand is num) {
+ return leftOperand + rightOperand;
+ }
+ if (leftOperand is String && rightOperand is String) {
return leftOperand + rightOperand;
}
} else if (node.operator.type == TokenType.STAR) {
« 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