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

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

Issue 2541603002: Support for AwaitExpression in unlinked expressions. (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 7bfbed1de4168e81c39c01b1e95a1538e8de67d5..5c8aff672d2ba7c76eceb4a78d21bfab2083421e 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -2228,6 +2228,9 @@ class ExprTypeComputer {
case UnlinkedExprOperation.assignToIndex:
_doAssignToIndex();
break;
+ case UnlinkedExprOperation.await:
+ _doAwait();
+ break;
case UnlinkedExprOperation.extractIndex:
_doExtractIndex();
break;
@@ -2363,6 +2366,14 @@ class ExprTypeComputer {
}
}
+ void _doAwait() {
+ DartType type = stack.removeLast();
+ DartType typeArgument = linker.typeSystem
+ .mostSpecificTypeArgument(type, linker.typeProvider.futureType);
+ typeArgument = _dynamicIfNull(typeArgument);
+ stack.add(typeArgument);
Paul Berry 2016/11/29 19:15:57 Do we need to flatten futures here? The spec says
scheglov 2016/11/29 19:39:13 Done.
+ }
+
void _doConditional() {
DartType elseType = stack.removeLast();
DartType thenType = stack.removeLast();
@@ -3413,10 +3424,10 @@ abstract class LibraryElementForLink<
_linkedLibrary.importDependencies.map(_getDependency).toList();
@override
- bool get isDartAsync => _absoluteUri == 'dart:async';
+ bool get isDartAsync => _absoluteUri.toString() == 'dart:async';
@override
- bool get isDartCore => _absoluteUri == 'dart:core';
+ bool get isDartCore => _absoluteUri.toString() == 'dart:core';
/**
* If this library is part of the build unit being linked, return the library

Powered by Google App Engine
This is Rietveld 408576698