-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Add numeric constraints to type parameters of mapped types with array/tuple intersections constraints #60084
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
base: main
Are you sure you want to change the base?
Conversation
…/tuple intersections constraints
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
Curious how this has the same vue change as #55386 |
It happens to behave in the same way because the created substitution type has This PR here ends up reading similar information but this time through correct functions. In the case of the substation type However, this still boils down to an existing issue: #59260 |
this, I feel, is something that was missed in #57801
Given this code:
The apparent type of this mapped type is
({ bar: number; } & { foo: string; })[]
(since #57801 ). So it only makes sense to treatT[I]
as access with this numeric constraint forI
. In other words, it only makes sense to treatT[I]
as accessing an element of an array/tuple