sdk icon indicating copy to clipboard operation
sdk copied to clipboard

New Hint: replace alwaysThrows with Never

Open srawlins opened this issue 3 years ago • 0 comments

The @alwaysThrows annotation can be replaced with a return type of Never.

A @deprecated annotation on alwaysThrows would report for pre-null safe code, so we should not do that. Instead, perhaps a new Hint: if a library is null safe, it should not reference alwaysThrows.

Also a quick fix for the new Hint.

See also https://github.com/dart-lang/sdk/issues/49567

srawlins avatar Aug 02 '22 23:08 srawlins