-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
TS2536 only when type argument is a generic type parameter #59000
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
Comments
I don't think we'll ever have the kind of logic that would be needed to determine that |
This issue has been marked as "Design Limitation" 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
ts2536, ts2536 generic, generic constraint no effect
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
An error is reported when indexing
PartialOnUndefined<T>
with type"foo"
where generic type parameterT
extends{ foo: string; }
:π Expected behavior
There should be no error; TS should be able to determine that
"foo"
can always indexPartialOnUndefined<T>
, sinceT
extends{ foo: string; }
.Additional information about the issue
Possibly related to #36631
Workarounds:
ts-ignore
comment to silence the error; the type alias can still be used without issue.PartialOnUndefined<T>
:The text was updated successfully, but these errors were encountered: