-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Generic type parameter loses defined constraint #51009
Comments
@typescript-bot bisect this |
@typescript-bot bisect good v4.8.2 bad main |
The change between v4.8.2 and main occurred at 4110b80. |
This regression is specifically caused by including In this very case, the source is So it seems that the added condition should be only added conditionally - but I don't know what that conditions should be. I've poked around this and tried a couple of things but couldn't make it work. |
I added the |
And, BTW, looks like #51041 is a duplicate of this issue. |
Bug Report
π Search Terms
type parameter constraint
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
In
R
,TypeA[T]
causes an error: Type 'T' cannot be used to index type 'TypeA'.π Expected behavior
TypeA[T]
should work sinceT
is by definition constrained to be akeyof TypeA
The text was updated successfully, but these errors were encountered: