-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Intersection Types can be cast to any type V as long as it is nullable #45640
Comments
Sounds like it was just a bug in 4.3.5. |
Yes, I would assume this is something that needs to be patched on the 4.3.x minor version only |
It's worth noting that 4.3.5 is the default version used in the latest VS Code, so it is probably widely used |
But you don't compile with the TypeScript version shipped with VSCode. And I'm confident that with the next August release of VSCode they will ship 4.4, as per microsoft/vscode#130601. |
Okay, well regardless of VS Code, there are people who use 4.3.x to build their code. 4.4.x has breaking changes. There should be a way to address this issue without requiring users to take on breaking changes. This is what the patch version is for. Ultimately I can't make you fix it. I found a serious bug that wasted my time and I wanted to save other people the hassle by writing up a report. |
We'll monitor comments on this issue, but if it wasn't noticed until a full version later, it's unlikely this warrants a patch. |
Bug Report
🔎 Search Terms
intersection
type
cast
null
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
In v4.3.5, we don't see the expected type error when casting an intersection type to null or null unions.
This issue does not occur in earlier or later versions.
🙂 Expected behavior
The type error behavior does not change depending on what version is being used, unless there is a well-documented breaking change.
The text was updated successfully, but these errors were encountered: