-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Narrowing on obj.prop doesn't propagate to obj #57290
Labels
Duplicate
An existing issue was already created
Comments
Duplicate of #42384 and many many others. |
oops @MartinJohns beat me to it this time |
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
π Search Terms
narrowing intersection property type guard assertion
π Version & Regression Information
occurs on:
5.3.3
5.4.0-dev.20240204
β― Playground Link
https://www.typescriptlang.org/play?ts=5.4.0-dev.20240204#code/JYOwLgpgTgZghgYwgAgILIN4Chm+QDwH4AuZEAVwFsAjaAbiwF8tRJZEUAhZCfSEACYBnNJhx58pCjXpMsWGORAIwwAPYhkMABRxSqAJRi8yYDGTawATwAOENebgA6fMgC8H5ACJptKF4NsExNyIQgAOSo-XRcDOmQAegTkNQBrcWDkUIhOXTjE5OgoNSgM5GZmBSUVdU1s3OpSTiNsOSrlVQ0ssMiZKG1JMijoQPlKpNNwaDCaroA3adqsaztkAGF3YwkSIb6GZhWUABFNjYAyLdxB31lKxQ7arQBmbQRSNZayswtDh2QEFzuTw+Yb+UaZXDZXrRAH4fITNJlEJhI6veGFKDFUomCrye6zOoo7QCUhHT5yIA
π» Code
π Actual behavior
Cannot assign
a
to parameter of typeB
. It seems type narrowing works independently ona.x
anda
.π Expected behavior
a
should be assignable to parameter of typeB
.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: