-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Inconsistent behavior of the never return type between function and class method #61464
Comments
This is working as intended. See #32695, or search for the many duplicates using |
I'm not sure I'm following you there. This issue is about |
It is indeed #36295.
Your second example doesn’t work because |
Ok, I did not get that. I assumed Thanks to both of you, I'm closing this. |
🔎 Search Terms
never return type
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?target=99&moduleResolution=99&esModuleInterop=false&strictBuiltinIteratorReturn=false&useUnknownInCatchVariables=false&alwaysStrict=false&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&suppressImplicitAnyIndexErrors=false&suppressExcessPropertyErrors=false&allowUnreachableCode=true&declaration=false&jsx=0#code/JYOwLgpgTgZghgYwgAgCoAtQHNkG9kAOUA9gQFzIDOYU2yAvgFAAmECANnFCjAK4gIwwYiGRYIYAMrEAthMwgsACgCUFDHQA+yEL3btGjAPRHkAQWR8BQkcjDo4YHRABu0ZNzC8oISoyuCwqLwwOyqFCCu7riMyHF26CQA7s4pAKJQJFBKAOTEpJQ5KoxMjAgi1AnYAIzIALxiEtJy9tiqjMAwyEoAhK2K1cXxlnCh7f1Y1QB0RKTxJsgAPAC0y1UDyMCUaAo4gKDkhgsWHHCU20nA9shwyC3oxMwJjs5uUB4S3r5lnGfIaQAel2isXiITCahewOGw3syVSf0yxGyeQKRRBcSYpXKvic-xo9XhAKB2WK2MqEwATATxFJZPI2sVOt0+rsKUN4nioFMweNWTMSAR5qYVmtKZtthpFMhtLp9MhADLkhmMpgAQrwnPYUHAAEbENzIJJIgDW53QEFEmuQxG1ACs2E4toRTpQII9TtcnVA4C13IA+DcAKLv+fiBWwwEBKCCAyBQChE6MqPDo5BkjW7ADM1KadIm7WGTN6EzT7OhyEjxO5o3BScL-LmcQWIvWWAzjsl+xKjCAA
💻 Code
🙁 Actual behavior
'thing2' is possibly 'null'. (ts18047)
on case 2.🙂 Expected behavior
Should compile.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: