dart-sdk/pkg/dart2wasm
Ömer Sinan Ağacan 478f2bb34c [dart2wasm] Handle switches with just a default case
Currently switch compiler looks at literals in alternatives to determine
how to check for equality.

When a switch statement only has a default case (no literals) the code
fails to determine the type of the expression in case statement and
assumes `bool`. Fixed by checking for these cases.

These tests now pass:

- co19/Language/Statements/Switch/syntax_t01
- co19/Language/Statements/Switch/execution_t02
- language/nnbd/flow_analysis/write_promoted_value_in_switch_test

Change-Id: If277b5a2dd04dd84d8d4ab6227d95c049d71f0e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264681
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-10-26 16:50:28 +00:00
..
bin [dart2wasm] Wire up cfe experimental flags. 2022-10-17 21:01:33 +00:00
lib [dart2wasm] Handle switches with just a default case 2022-10-26 16:50:28 +00:00
analysis_options.yaml [pkg/dart2wasm] use package:lints for analysis 2022-07-07 00:16:01 +00:00
dart2wasm.md [dart2wasm] Partially lazy constants 2022-09-28 15:20:46 +00:00
OWNERS
pubspec.yaml [dart2wasm] Partially lazy constants 2022-09-28 15:20:46 +00:00