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

Unified Diff: pkg/kernel/lib/transformations/continuation.dart

Issue 2792033002: [kernel] vm: Fix a few issues in the kernel flow graph builder, update status file for checked-mode (Closed)
Patch Set: addressed comments Created 3 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
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/continuation.dart
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index 2ba5d0620bbfb81cc7c8ffc56da454bcce1a1f6e..5d958404725dc1fb2a05bf1de41249edb4f5f818 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -794,6 +794,10 @@ class AsyncFunctionRewriter extends AsyncRewriterBase {
}
}
}
+ // In an "Future<FooBar> foo() async {}" function the body can either return
+ // a "FooBar" or a "Future<FooBar>" => a "FutureOr<FooBar>".
+ returnType =
+ new InterfaceType(helper.futureOrClass, <DartType>[returnType]);
var completerTypeArguments = <DartType>[returnType];
var completerType =
new InterfaceType(helper.completerClass, completerTypeArguments);
@@ -871,6 +875,7 @@ class HelperNodes {
final Library coreLibrary;
final Class iteratorClass;
final Class futureClass;
+ final Class futureOrClass;
final Class completerClass;
final Procedure printProcedure;
final Procedure completerConstructor;
@@ -888,6 +893,7 @@ class HelperNodes {
this.coreLibrary,
this.iteratorClass,
this.futureClass,
+ this.futureOrClass,
this.completerClass,
this.printProcedure,
this.completerConstructor,
@@ -907,6 +913,7 @@ class HelperNodes {
coreTypes.getLibrary('dart:core'),
coreTypes.getClass('dart:core', 'Iterator'),
coreTypes.getClass('dart:async', 'Future'),
+ coreTypes.getClass('dart:async', 'FutureOr'),
coreTypes.getClass('dart:async', 'Completer'),
coreTypes.getTopLevelMember('dart:core', 'print'),
coreTypes.getMember('dart:async', 'Completer', 'sync'),
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698