-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Pick type can't use common key types such as string, like Omit type #36074
Comments
Duplicate of #30825 and may other? |
No. That issue suggested the stricter Omit type but conversely this issue suggests the looser Pick type. |
We can't really change either of them after they've shipped. You're free to use your own definitions if you'd like. |
@RyanCavanaugh However, this change seems to make no breaking changes because this change just looses the constraint, right? I want you to answer this point. |
I can't find the actual problem this improvement makes. |
People complained that the |
...Do you complain the same thing as that people? Eventually, the current definitions of the |
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow. |
I'm not sure why the Pick type has the
keyof T
constraint although the Omit type doesn't have.TypeScript Version: 3.7.x-dev.20200107
Search Terms:
Code
Expected behavior:
pass
Actual behavior:
Type 'symbol' does not satisfy the constraint 'unique symbol | "p"'.(2344)
Type 'string | number' does not satisfy the constraint 'keyof T'.
Type 'string' is not assignable to type 'keyof T'.(2344)
Playground Link: http://www.typescriptlang.org/play/index.html?ts=3.8.0-dev.20200107#code/MYewdgzgLgBBCeBbGBeGBlJAjEAbAFAJQDcAUMLgIYQQwDCMA3qTKzAA6owAMZbMAbQSIAugC4YAcklkAvqSjx2AUxiUuABQCWwANYAeOgBo42PAD4yilTCxcA8oi1RDJ6ACctYAOaWFS1XQodwBXYCgQ90pcfQAVc00dA1i3YK9vGAAfGDAQxCxld0sgA
Related Issues:
The text was updated successfully, but these errors were encountered: