sdk icon indicating copy to clipboard operation
sdk copied to clipboard

unnecessary_return: "return throw Something()"

Open matanlurey opened this issue 3 years ago • 3 comments

void main() {
  example();
}

String example() {
  return throw StateError('');
}

I should have written throw StateError(''), oops. This would be nice to include under the unnecessary_* set of hints.

(If this should be a lint instead of a hint, feel free to move it!)

matanlurey avatar Aug 13 '22 23:08 matanlurey