Files
sdk/tests/language
Paul Berry eec56c088e [flow analysis] Mark false branches of trivial is tests unreachable.
When an `is` test is trivially satisfied (i.e. `expr is T`, when the
static type of `expr` is a subtype of `T`), the `is` test is
guaranteed by soundness to evaluate to `true`, so any code path that
follows from the `is` test evaluating to `false` is unreachable.

This reasoning wasn't valid prior to sound null safety, because in
mixed mode programs, it was possible for an expression to evaluate to
`null` even if its static type wasn't nullable, and hence `expr is T`
might evaluate to `false` even if the static type of `expr` was a
subtype of `T`. So this change is gated on the `sound-flow-analysis`
language flag (which is enabled in Dart 3.9).

Fixes https://github.com/dart-lang/sdk/issues/60718.

Change-Id: I66a65580b738162f23b6fb468b71fcac66bfbb95
Bug: https://github.com/dart-lang/sdk/issues/60718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431740
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-04 05:17:21 -07:00
..
2024-12-13 10:52:25 -08:00
2024-12-20 02:39:21 -08:00
2024-12-20 02:39:21 -08:00
2024-12-12 15:50:08 -08:00
2025-02-26 10:39:51 -08:00
2025-04-08 03:49:31 -07:00
2025-02-05 08:36:21 -08:00
2025-02-05 08:36:21 -08:00
2025-02-05 08:36:21 -08:00
2025-02-19 04:21:42 -08:00
2025-02-04 14:28:36 -08:00
2025-02-19 04:21:42 -08:00
2025-02-19 04:21:42 -08:00
2025-04-08 03:49:31 -07:00
2025-04-08 03:49:31 -07:00
2025-02-19 04:21:42 -08:00
2025-02-11 15:43:32 -08:00
2025-02-19 04:21:42 -08:00
2025-02-11 15:31:25 -08:00
2025-02-11 15:31:25 -08:00
2025-02-11 15:31:25 -08:00
2025-02-11 15:31:25 -08:00