Implement FutureOr<T> for dart2js.

In dart2js, FutureOr<T> should simply be treated as `dynamic`.

Fixes #28011
BUG= http://dartbug.com/28011
R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2559523006 .
This commit is contained in:
Florian Loitsch 2016-12-12 15:21:03 +01:00
parent 0c3deba6df
commit cc2eba8c2a
2 changed files with 5 additions and 4 deletions

View file

@ -154,6 +154,11 @@ class TypeResolver {
} else if (!element.impliesType) {
type = reportFailureAndCreateType(
MessageKind.NOT_A_TYPE, {'node': node.typeName});
} else if (element.library.isPlatformLibrary &&
element.name == 'FutureOr') {
type = const DynamicType();
registry.useType(node, type);
return type;
} else {
bool addTypeVariableBoundsCheck = false;
if (element.isClass) {

View file

@ -8,10 +8,6 @@ mirrors/redirecting_factory_different_type_test: SkipByDesign # Tests type check
[ $compiler == dart2js ]
async/schedule_microtask6_test: RuntimeError # global error handling is not supported. Issue 5958
async/future_or_bad_type_test/00: RuntimeError # Issue 28011
async/future_or_bad_type_test/01: RuntimeError # Issue 28011
async/future_or_bad_type_test/implements: MissingCompileTimeError # Issue 28011
async/future_or_non_strong_test: RuntimeError # Issue 28011
async/future_or_strong_test: RuntimeError, OK
math/double_pow_test: RuntimeError