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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2514353005: Add support for "??" to summaries. (Closed)
Patch Set: Created 4 years, 1 month 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/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 6b2e1d711bb79d8355471647a36aa08ece60df86..f4486bb0e969784fc79068f47f3075497563bd13 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -2265,6 +2265,9 @@ class ExprTypeComputer {
case UnlinkedExprOperation.pushParameter:
stack.add(_findParameterType(_getNextString()));
break;
+ case UnlinkedExprOperation.ifNull:
+ _doIfNull();
+ break;
default:
// TODO(paulberry): implement.
throw new UnimplementedError('$operation');
@@ -2404,6 +2407,14 @@ class ExprTypeComputer {
}());
}
+ void _doIfNull() {
+ DartType secondType = stack.removeLast();
+ DartType firstType = stack.removeLast();
+ DartType type = _leastUpperBound(firstType, secondType);
+ type = _dynamicIfNull(type);
+ stack.add(type);
+ }
+
void _doInvokeConstructor() {
int numNamed = _getNextInt();
int numPositional = _getNextInt();

Powered by Google App Engine
This is Rietveld 408576698