sdk
sdk copied to clipboard
New Hint: replace alwaysThrows with Never
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