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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 1575173005: checking and inference of null coalescing operator, fixes #24564 and fixes #25387 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index d6c436857dc59ce24c97ba4386e5ee47518aa2e7..29857b009340d6eebebdc988fec351bc84374f6c 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -189,11 +189,12 @@ class CodeChecker extends RecursiveAstVisitor {
@override
void visitAssignmentExpression(AssignmentExpression node) {
var token = node.operator;
- if (token.type != TokenType.EQ) {
- _checkCompoundAssignment(node);
- } else {
+ if (token.type == TokenType.EQ ||
+ token.type == TokenType.QUESTION_QUESTION_EQ) {
DartType staticType = _getStaticType(node.leftHandSide);
checkAssignment(node.rightHandSide, staticType);
+ } else {
+ _checkCompoundAssignment(node);
}
node.visitChildren(this);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698