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

Unified Diff: runtime/vm/parser.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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index afa023ae0713741b21a16bc18e0d1aa10310b597..923526885ecea9685b32b527aa03bcd12b6b9592 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -12045,6 +12045,13 @@ void Parser::ResolveType(ClassFinalizer::FinalizationKind finalization,
parameterized_type.set_signature(
Function::Handle(Z, resolved_type_class.signature_function()));
}
+ // Replace FutureOr<T> type of async library with dynamic.
+ if ((resolved_type_class.library() == Library::AsyncLibrary()) &&
+ (resolved_type_class.Name() == Symbols::FutureOr().raw())) {
+ parameterized_type.set_type_class(
+ Class::Handle(Object::dynamic_class()));
+ parameterized_type.set_arguments(Object::null_type_arguments());
+ }
} else if (finalization >= ClassFinalizer::kCanonicalize) {
ClassFinalizer::FinalizeMalformedType(
Error::Handle(Z), // No previous error.

Powered by Google App Engine
This is Rietveld 408576698