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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2788933002: Fix ignore on FutureOr (Closed)
Patch Set: Reformat 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 | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 9eba1b2c3ad6fb79a9bfcc0a2b007cc5ea2579c6..b326b6614a73d656ae10b03508a8768b51a3c315 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -470,8 +470,16 @@ final _ignoreTypeFailure = JS(
// TODO(vsm): Remove this hack ...
// This is primarily due to the lack of generic methods,
// but we need to triage all the types.
+ if ($_isFutureOr(type)) {
+ // Ignore if we would ignore either side of union.
+ let typeArg = $getGenericArgs(type)[0];
+ let typeFuture = ${getGenericClass(Future)}(typeArg);
+ return $_ignoreTypeFailure(actual, typeFuture) ||
+ $_ignoreTypeFailure(actual, typeArg);
+ }
+
if (!!$isSubtype(type, $Iterable) && !!$isSubtype(actual, $Iterable) ||
- !!$isSubtype(type, $FutureOr) && !!$isSubtype(actual, $Future) ||
+ !!$isSubtype(type, $Future) && !!$isSubtype(actual, $Future) ||
!!$isSubtype(type, $Map) && !!$isSubtype(actual, $Map) ||
$isFunctionType(type) && $isFunctionType(actual) ||
!!$isSubtype(type, $Stream) && !!$isSubtype(actual, $Stream) ||
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698