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

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

Issue 1052243002: Implement the new '??=' operator in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index d1997f3f0495f933b7d00c8740fd4edde86a7c5e..a78311fcd86a8d81b2602191ac34b6c0ddfc877d 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -157,6 +157,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
overrideType = propagatedType;
}
_resolver.overrideExpression(node.leftHandSide, overrideType, true);
+ } else if (operator == sc.TokenType.QUESTION_QUESTION_EQ) {
+ // The static type of a compound assignment using ??= is the least upper
+ // bound of the static types of the LHS and RHS.
+ _analyzeLeastUpperBound(node, node.leftHandSide, node.rightHandSide);
+ return null;
} else {
ExecutableElement staticMethodElement = node.staticElement;
DartType staticType = _computeStaticReturnType(staticMethodElement);
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698