Open
Description
When using the "convert to switch expression", the "when" parts are removed, which is very error prone (if you have a default case, you may miss it is gone)
Example:
int foo(int a, bool x) {
switch (a) {
case 1 when x:
return 1;
default:
return 3;
}
}
becomes
int foo(int a, bool x) {
return switch (a) {
1 => 1,
_ => 3
};
}
Tested with both Dart 3.8.1 (flutter stable) and 3.9.0-241.0.dev