-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Incorrect never
type inference.
#44025
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
Comments
Previously a non-null assertion on a variable with inferred |
I've updated the example from return abc ? abc!.attrib : null; to return abc ? abc.attrib : null; |
Sorry for the confusion in the original example, maybe this was not related to the non-null assertion ( |
Bug Report
The type inference does not consider(or be conservative on) side effects of function calls.
Might be a related issue the first failure report in #43819
🔎 Search Terms
does not exist on type never
🕗 Version & Regression Information
4.2.3
and4.3
4.3.1-rc
with git hashd805ce877ae6235565ee697c3c0ce8a95a9c58f6
⏯ Playground Link
Playground link
💻 Code
You need to enable the --strictNullChecks to trigger the bug
./bin/tsc test.ts --strictNullChecks
🙁 Actual behavior
tsc prints the following error :
🙂 Expected behavior
Not report the error.
The text was updated successfully, but these errors were encountered: