dart-sdk/sdk
Aske Simon Christensen 4090d3b909 [dart2wasm] Normalize FutureOr<T> as nullable when T is nullable
The type normalization rules specify that `FutureOr<T>?` is normalized
to `FutureOr<T>` when `T` is nullable. However, it's more practical
for subtype testing if the declared nullability on the runtime
representation of the `FutureOr` type reflects the true nullability
(nullable if the `FutureOr` is declared nullable or its type argument
is nullable), rather than being normalized as per the spec.

This changes the static and dynamic normalization rules in dart2wasm
thus and compensates by computing the proper spec normalization when
the type is converted to a string.

The added test exposed a number of bugs in DDC and the VM:

https://github.com/dart-lang/sdk/issues/53175
https://github.com/dart-lang/sdk/issues/53737
https://github.com/dart-lang/sdk/issues/53738

Change-Id: I0ad0a09fe935ccbd3eb65e6958c958d29e0bb088
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320821
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-10-12 15:29:26 +00:00
..
bin Update Binaryen to a51bd6df919a5b79574f0996a760cc20cb05697e 2023-09-21 11:47:59 +00:00
lib [dart2wasm] Normalize FutureOr<T> as nullable when T is nullable 2023-10-12 15:29:26 +00:00
.gitignore [sdk] Generate a version file for the unpatched SDK 2022-05-05 10:36:05 +00:00
api_readme.md [docs] fix a grammar issue in the sdk readme 2023-04-26 18:25:55 +00:00
BUILD.gn [Reland] [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot 2023-09-26 21:46:58 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00