“Convert into block body” adds unnecessary `return` before a `throw`

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?

Author: Fantashit

1 thought on ““Convert into block body” adds unnecessary `return` before a `throw`

Comments are closed.