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

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

Issue 2541603002: Support for AwaitExpression in unlinked expressions. (Closed)
Patch Set: Use DartType.flattenFutures() 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cfee0e2d7d1d24e5948e6c110b05f8e6ed84fb6e..26aafa86d97bd4b48ee5859790d10fcc227f6712 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,13 @@ class ExprTypeComputer {
}
}
+ void _doAwait() {
+ DartType type = stack.removeLast();
+ DartType typeArgument = type?.flattenFutures(linker.typeSystem);
+ typeArgument = _dynamicIfNull(typeArgument);
+ stack.add(typeArgument);
+ }
+
void _doConditional() {
DartType elseType = stack.removeLast();
DartType thenType = stack.removeLast();
@@ -3413,10 +3423,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
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698