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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 2642443002: Support FutureOr<T> in the VM (fixes #28010). (Closed)
Patch Set: Created 3 years, 11 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/parser.cc » ('j') | tests/lib/mirrors/hierarchy_invariants_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index be24a412b4e6cedd580541084fa323ae30e6ec64..c319f1f18c42b75239ae97e4b544a5692e6e2d02 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -516,6 +516,13 @@ void ClassFinalizer::ResolveTypeClass(const Class& cls, const Type& type) {
}
ASSERT(!type_class.IsTypedefClass() ||
(type.signature() != Function::null()));
+
+ // Replace FutureOr<T> type of async library with dynamic.
+ if ((type_class.library() == Library::AsyncLibrary()) &&
+ (type_class.Name() == Symbols::FutureOr().raw())) {
+ Type::Cast(type).set_type_class(Class::Handle(Object::dynamic_class()));
+ type.set_arguments(Object::null_type_arguments());
+ }
}
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | tests/lib/mirrors/hierarchy_invariants_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698