Given
void foo() => throw 'bad';
Place the cursor on the => and run the assist "Convert into block body".
I expected
void foo() {
throw 'bad';
}
I got
void foo() {
return throw 'bad';
}
What is the type of a throw expression? Apparently it does not show up as isVoid?
https://github.com/dart-lang/sdk/blob/706d3382edf7d0292324d3f04f4f0472410ed604/pkg/analysis_server/lib/src/services/correction/assist_internal.dart#L707
What is the type of a throw expression?
According to the specification:
The static type of a throw expression is ⊥.
Looks like this condition needs to check for bottom.
Most helpful comment
https://dart-review.googlesource.com/c/sdk/+/31962