dart-sdk/runtime
Alexander Markov 66f1dee48c [vm] Runtime type check in await
'await e' should check that e is a Future<flatten(S)>, where S is a
static type of e before awaiting e. If e is not a Future<flatten(S)>,
then 'await e' should await Future.value(e) instead of e. So futures
of incompatible type are not awaited and soundness is not violated.

TEST=tests/language/async/await_type_check_test.dart
(Based on https://dart-review.git.corp.google.com/c/sdk/+/267422.)

Fixes https://github.com/dart-lang/sdk/issues/50529
Part of https://github.com/dart-lang/sdk/issues/49396

Change-Id: Ia418db1be6736710abc9be87d95584c50cbc677e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273002
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-07 22:46:22 +00:00
..
bin [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default. 2022-12-06 04:04:23 +00:00
docs [vm] Runtime type check in await 2022-12-07 22:46:22 +00:00
include [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default. 2022-12-06 04:04:23 +00:00
lib [vm/ffi] Ensure there's a single Function object per ffi-callback + exceptional-return combination 2022-12-07 20:47:13 +00:00
observatory [3.0 alpha] Bump version to 3.0.0 2022-12-06 02:40:36 +00:00
observatory_2 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default. 2022-12-06 04:04:23 +00:00
platform [vm/api] Introduce Dart_WriteHeapSnapshot API 2022-12-01 14:38:44 +00:00
tests [vm] Always share double/float32x4/float64x2/int32x4 in inter-isolate messages 2022-12-07 00:48:28 +00:00
third_party [build] Switch builds to the ninja in DEPS 2022-09-27 11:24:03 +00:00
tools [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default. 2022-12-06 04:04:23 +00:00
vm [vm] Runtime type check in await 2022-12-07 22:46:22 +00:00
.clang-tidy
.gitignore
BUILD.gn [vm/ffi] FfiNative process lookup 2022-10-25 10:57:07 +00:00
codereview.settings
configs.gni [vm/ffi] FfiNative process lookup 2022-10-25 10:57:07 +00:00
CPPLINT.cfg
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
PRESUBMIT.py [python3] Migrate PRESUBMIT.py files 2021-08-16 08:29:54 +00:00
runtime_args.gni [VM] error: ‘mallinfo mallinfo()’ is deprecated 2021-12-08 00:25:10 +00:00