-
Notifications
You must be signed in to change notification settings - Fork 12.8k
False positive error when accessing property method that returns never
using --strict
#46254
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
never
using --strict
never
using --strict
Duplicate of #12825. Although I'm surprised only one of those two errors. This changed with TypeScript 3.7, so it's most likely related to the changes of #32695. I would guess the same rules for assertion-functions apply here. The |
@MartinJohns Nice find! That issue is indeed related but I don't think it's a duplicate. I removed the |
It's still related to control flow. It doesn't consider the |
@MartinJohns You're right, this issue is about control flow. This is indeed a duplicate. Thank you! |
Bug Report
I get a compile error when calling a property method that returns
never
using--strict
, when I expect to get no compile error. I am unable to reproduce the error with toplevel functions.🔎 Search Terms
🕗 Version & Regression Information
never
⏯ Playground Link
Playground link https://www.typescriptlang.org/play?ts=4.5.0-beta#code/EQVwzgpgBGAuBOBLAxrYBuAUAMxAO1UQHs8oAjIogWwAoBKALijwgDcJ4oBvTKKWABbwiAd2YQxAUXjD4NAOQVq8upgC+mTMhJwoAeRCwOUALzdefcpVqNx7Tj0tP+Q0eKkyicxdZUW+GhpaADYAhmBgUABCoQ7+UAAOIGTBKFbUAGL4hCT0THggVGTGjs58SjbxGk5JKWkVAArCCRywAJ55zIXFcWV8BkbwAHQV9FXqmEA
💻 Code
Minimized reproduction
🙁 Actual behavior
🙂 Expected behavior
I expected there to be 0 errors because there is no error for
boomFunction()
, onlyboomProperty()
.Workarounds
return Outer.boom()
.--strict
flag.The text was updated successfully, but these errors were encountered: