-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
noUncheckedIndexedAccess
does not narrow properly with "prop" in obj
#43614
Comments
Seems related to #41848 |
This isnβt really related to You should check for equality / non-equality with |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Not sure I understand. The type of How does |
Ah, I see. When you set |
With exactOptionalPropertyTypes, unchecked index access could map to Then Example highlighting the obvious disparity: |
This seems like a bug rather than a design limitation then. |
I agree that this is neither a design limitation nor working as intended. This is simply a bug and @derolf's example proves it. |
Bug Report
Apologies if this is a duplicate, but I wasn't able to find anything.
π Search Terms
noUncheckedIndexedAccess property in object
β― Playground Link
Playground link
π» Code
π Actual behavior
x
is typed asstring | undefined
π Expected behavior
x
should be typed asstring
The text was updated successfully, but these errors were encountered: