mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
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:
parent
0c3deba6df
commit
cc2eba8c2a
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue