dart-sdk/tests/lib
Lasse R.H. Nielsen 478602ad79 Fix errors in Future implementation around Future<Future<X>>.
Previously, when completing a future with another future,
we always chained to the other future. This effectively awaits
the latter future and then completes the former with its result.
This is incorrect behavior if the former future is, say,
a `Future<Future<int>>` and the latter is a `Future<int>`.
In that case we *must not* await the latter future
because we can't complete the former future with an `int`.
We should just complete the future directly with the latter future
as a value.

We now check first whether to chain a `Future<T>` to another
future, and only does so if the latter future is a `Future<T>`
(or it's not a `T`, which shouldn't happen,
but currently does in some places).

Add test for behavior.

Change-Id: I57e27111c2fc7b7792dcf4ae9b7c1d5d504d0c0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/53602
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-12-14 16:34:28 +00:00
..
analyzer Set up new test suites for migrating the tests to NNBD. 2019-11-19 00:18:43 +00:00
async Fix errors in Future implementation around Future<Future<X>>. 2020-12-14 16:34:28 +00:00
collection Update LinkedList.contains to take advantage of internal structure. 2020-12-02 14:08:08 +00:00
convert Adjust UTF-8 tests to match WHATWG standard expectations. 2020-05-04 10:48:32 +00:00
developer Migrate lib_2/developer/timeline_recorders_test.dart to null safety. 2020-06-25 21:21:32 +00:00
html [ddc] Change is checks for JS types 2020-12-10 01:38:26 +00:00
isolate [Tests] - Fix the spawnuri autodetect tests. 2020-11-04 17:50:27 +00:00
js [ddc] Change is checks for JS types 2020-12-10 01:38:26 +00:00
math Avoid shift in math/random_big_test 2020-12-04 23:46:34 +00:00
mirrors Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety 2020-11-05 14:26:53 +00:00
typed_data Fix unmodifiable_typed_data_test 2020-12-04 23:46:42 +00:00
wasm [wasm] Use wasm traps to handle exceptions 2020-11-02 23:32:20 +00:00
web [web] remove mirrors patch for web compilers. 2020-07-16 00:12:22 +00:00
analysis_options.yaml [tests] Add analysis options file to migrated test directories 2020-03-16 20:51:26 +00:00
lib.status Filter out lib/js/mock_test from csp 2020-12-10 18:28:57 +00:00
lib_analyzer.status Set up new test suites for migrating the tests to NNBD. 2019-11-19 00:18:43 +00:00
lib_app_jit.status Set up new test suites for migrating the tests to NNBD. 2019-11-19 00:18:43 +00:00
lib_dart2js.status [tests] Fix some typed_data int64 tests 2020-12-05 01:31:42 +00:00
lib_dartdevc.status Fix unmodifiable_typed_data_test 2020-12-04 23:46:42 +00:00
lib_kernel.status Remove remaining tests for bytecode mode 2020-10-09 22:30:19 +00:00
lib_precompiled.status Set up new test suites for migrating the tests to NNBD. 2019-11-19 00:18:43 +00:00
lib_vm.status [vm/concurrency] As preparation step to sharing JITed code, disable various optimizations 2020-11-26 15:08:35 +00:00