-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Types have no overlap ts(2367) error does not account for subtyping #48628
Comments
#9998 is unrelated, that's about control-flow analysis limitations across function boundaries which doesn't apply here. The blog post you linked talks about exact types, and there's already an issue for that - #12936. In this case you essentially have For what it's worth, I am surprised that the error message claims that there's no overlap at all -- I had thought the wording was at one point "...neither type sufficiently overlaps with the other." |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
It's entirely fixable. No one has sent a fix, and the team is busy doing things that only the team can do (versus rewording something, which pretty much anyone could do). |
Bug Report
🔎 Search Terms
is:issue overlap ts(2367)
(Could be relevant to #9998
However I have not seen equivalent example discussed there and seems to be a different topic.)
🕗 Version & Regression Information
Tested with 4.6.3 and 4.5.2.
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Compiler reject a valid overlap
🙂 Expected behavior
Needs discussion. At the minimum the error message needs to be changes as it is incorrect as is.
My preference would be to have ability to disable subtyping and keep that message when it is disabled.
This is actually doable today but is it cumbersome (https://rpeszek.github.io/posts/2022-01-09-ts-types-part4.html#safety-preventing-subtyping)
(As I stated before, this could be relevant to #9998
However I have not seen equivalent example discussed there and seems to be a different topic.)
The text was updated successfully, but these errors were encountered: