sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Should pkg/meta's @alwaysThrows be deprecated for Dart v3?

Open matanlurey opened this issue 3 years ago • 1 comments

My understanding is that, similar to pkg/meta's @required, @alwaysThrows has no use in Dart v3:

// Dart v2 before null-safety
import 'package:meta/meta.dart';

@alwaysThrows
void a() => throw 'Always throws';
// Dart v2 after null-safety
Never a() => throw 'Always throws';

Anyone, not sure... figured I'd highlight this for others to look at.

matanlurey avatar Aug 01 '22 00:08 matanlurey

That's probably reasonable. The only place I can think of where the annotation can be used that Never can't be used is on a setter, but it seems highly unlikely that anyone's using the annotation on a setter.

bwilkerson avatar Aug 01 '22 04:08 bwilkerson

Oops, done.

srawlins avatar Jan 26 '23 18:01 srawlins