mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 12:30:03 +00:00
[js_runtime] Fix for 'o is FutureOr<T>' with function type T
Change-Id: I0533d565f7edf87ea9ac45e56e1e192658ec5849 Reviewed-on: https://dart-review.googlesource.com/55982 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
parent
d34fe65afa
commit
3ccd5a06f5
|
@ -829,6 +829,20 @@ Object getFutureOrArgument(var type) {
|
|||
bool checkSubtypeOfRuntimeType(o, t) {
|
||||
if (o == null) return isSupertypeOfNull(t);
|
||||
if (isTopType(t)) return true;
|
||||
if (JS_GET_FLAG('STRONG_MODE') &&
|
||||
JS('bool', 'typeof # == "object"', t) &&
|
||||
isDartFutureOrType(t)) {
|
||||
// `o is FutureOr<T>` is equivalent to
|
||||
//
|
||||
// o is T || o is Future<T>
|
||||
//
|
||||
// T might be a function type, requiring extracting the closure's signature,
|
||||
// so do the `o is T` check here and let the `Future` interface type test
|
||||
// fall through to the `isSubtype` check at the end of this function.
|
||||
var tTypeArgument = getFutureOrArgument(t);
|
||||
if (checkSubtypeOfRuntimeType(o, tTypeArgument)) return true;
|
||||
}
|
||||
|
||||
// Get the runtime type information from the object here, because we may
|
||||
// overwrite o with the interceptor below.
|
||||
var rti = getRuntimeTypeInfo(o);
|
||||
|
|
|
@ -540,12 +540,7 @@ async_await_test/02: RuntimeError
|
|||
async_await_test/03: RuntimeError
|
||||
async_await_test/none: RuntimeError
|
||||
async_star_cancel_while_paused_test: RuntimeError
|
||||
async_star_test/01: RuntimeError
|
||||
async_star_test/02: RuntimeError
|
||||
async_star_test/03: RuntimeError
|
||||
async_star_test/04: RuntimeError
|
||||
async_star_test/05: RuntimeError
|
||||
async_star_test/none: RuntimeError
|
||||
bad_override_test/03: MissingCompileTimeError
|
||||
bit_operations_test: RuntimeError
|
||||
branch_canonicalization_test: RuntimeError
|
||||
|
@ -904,12 +899,7 @@ async_or_generator_return_type_stacktrace_test/03: MissingCompileTimeError
|
|||
async_return_types_test/nestedFuture: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
|
||||
async_return_types_test/wrongReturnType: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
|
||||
async_star_cancel_while_paused_test: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
|
||||
async_star_test/01: RuntimeError
|
||||
async_star_test/02: RuntimeError
|
||||
async_star_test/03: RuntimeError
|
||||
async_star_test/04: RuntimeError
|
||||
async_star_test/05: RuntimeError
|
||||
async_star_test/none: RuntimeError
|
||||
await_not_started_immediately_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
|
||||
bad_override_test/01: MissingCompileTimeError
|
||||
bad_override_test/02: MissingCompileTimeError
|
||||
|
@ -1451,12 +1441,7 @@ async_or_generator_return_type_stacktrace_test/03: MissingCompileTimeError
|
|||
async_return_types_test/nestedFuture: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
|
||||
async_return_types_test/wrongReturnType: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
|
||||
async_star_cancel_while_paused_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
|
||||
async_star_test/01: RuntimeError
|
||||
async_star_test/02: RuntimeError
|
||||
async_star_test/03: RuntimeError
|
||||
async_star_test/04: RuntimeError
|
||||
async_star_test/05: RuntimeError
|
||||
async_star_test/none: RuntimeError
|
||||
await_not_started_immediately_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
|
||||
bad_override_test/01: MissingCompileTimeError
|
||||
bad_override_test/02: MissingCompileTimeError
|
||||
|
|
Loading…
Reference in a new issue