Files
sdk/tests/language
Alexander Markov 47abd96c5b Reland "[vm] Fix CompileType::CanBeFuture()"
This is a reland of commit 6f4bed30cc

Original change's description:
> [vm] Fix CompileType::CanBeFuture()
>
> In certain cases compiler can omit a type check in 'await e' if it can
> prove that expression 'e' cannot be evaluated to Future.
>
> Previously, if actual type of 'e' is unknown, CompileType::CanBeFuture()
> tested if static type of 'e' is a subtype of Future.
>
> This is not correct, as static type could have a subtype which is also
> a subtype of Future, but static type itself is not a subtype of Future:
>
> class A {}
> class B implements A, Future<A> {}
>
> A e = confuse(B()); // 'e' is B, but has a static type A.
> await e;            // A is not a subtype of Future, but 'e' is Future
>                     // and should be awaited.
>

TEST=language/async/await_flatten_test
Fixes https://github.com/dart-lang/sdk/issues/52585

Change-Id: I37add9021261c95dee5930e031187868e821c161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-06-15 00:34:18 +00:00
..
2022-12-19 16:30:06 +00:00
2022-10-17 08:18:49 +00:00
2022-06-10 15:48:54 +00:00
2022-12-19 16:30:06 +00:00
2023-01-19 16:24:29 +00:00
2022-12-19 16:30:06 +00:00
2023-01-26 09:12:41 +00:00
2023-04-25 21:28:39 +00:00
2023-02-01 10:06:37 +00:00
2022-06-15 11:08:28 +00:00
2023-02-08 17:45:40 +00:00