We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 3.8.3
Search Terms: arrow function never unreachable narrowing
Code
const f = (): never => { throw new Error() } f() // should be unreachable but isn't console.log()
Expected behavior: Unreachable code detected. (7027) warning on line 6 (last line).
Unreachable code detected. (7027)
Actual behavior: No warning.
Playground Link: link
Related Issues: #36753, #12825
The text was updated successfully, but these errors were encountered:
As mentioned in linked #36753 (and many other e.g. #37472 (comment)) - it's design limitation. Your const f needs explicit type annotation to participate in CFA. const f: () => never = ...
const f
const f: () => never = ...
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
(): never
never
No branches or pull requests
TypeScript Version: 3.8.3
Search Terms: arrow function never unreachable narrowing
Code
Expected behavior:
Unreachable code detected. (7027)
warning on line 6 (last line).Actual behavior:
No warning.
Playground Link: link
Related Issues: #36753, #12825
The text was updated successfully, but these errors were encountered: