-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
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
Support inferring never
as the return type in JavaScript when overriding a class method that returns never
#46791
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Has Repro
This issue has compiler-backed repros: https://aka.ms/ts-repros
Suggestion
An idea for TypeScript
Comments
The behavior is the same in TypeScript: Playground link This is the behaviour in general, not related to |
👋 Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of the repro in the issue body running against the nightly TypeScript. Issue body code block by @ExE-Boss ❌ Failed: -
Historical Information
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Has Repro
This issue has compiler-backed repros: https://aka.ms/ts-repros
Suggestion
An idea for TypeScript
Suggestion
🔍 Search Terms
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
When implementing an abstract method with a signature that returns
never
, the concrete implementation should have its return type inferred asnever
if the method body contains an explicitthrow
and noreturn
statements including the implicitreturn
.📃 Motivating Example
Workbench Repro:
💻 Use Cases
To get better type inference while working on engine262’s parser.
Relevant issues
The text was updated successfully, but these errors were encountered: