-
Notifications
You must be signed in to change notification settings - Fork 12.8k
feat(36327): libdef args rest type should always be array of any #36328
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
Conversation
It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move your changes to src/lib
.
Additionally, it looks like you closed the source bug, so maybe this PR should be closed too.
1ae7a07
to
ec983d8
Compare
My issue was related to another reason, so I closed it. But I still suggest to describe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing only the constraint type, as Parameters and ConstructorParameters do, should get rid of the diff in inferTypes1.types
. It's not a big diff, but it's nicer to avoid any changes at all.
src/lib/es5.d.ts
Outdated
|
||
/** | ||
* Obtain the return type of a function type | ||
*/ | ||
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any; | ||
type ReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => infer R ? R : any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type ReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => infer R ? R : any; | |
type ReturnType<T extends (...args: any[]) => any> = T extends (...args: any) => infer R ? R : any; | |
src/lib/es5.d.ts
Outdated
|
||
/** | ||
* Obtain the return type of a constructor function type | ||
*/ | ||
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any; | ||
type InstanceType<T extends new (...args: any[]) => any> = T extends new (...args: any[]) => infer R ? R : any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type InstanceType<T extends new (...args: any[]) => any> = T extends new (...args: any[]) => infer R ? R : any; | |
type InstanceType<T extends new (...args: any[]) => any> = T extends new (...args: any) => infer R ? R : any; | |
@typescript-bot run dt |
Is this change going to handle |
@sandersn @DanielRosenwasser |
@antongolub can you add tests for the cases @DanielRosenwasser pointed out? |
@typescript-bot run dt maybe it will work this time |
@typescript-bot @weswigham DT is (almost) clean but it did not contribute to the PR's status checks that I can see. |
Uhhh, yeah, the whole "contributes to status checks" bit was broken when we swapped to using the merge commit a few weeks ago instead of the branch head, because devops is bad. Should we swap back? IMO, forcing manual merges is probably worth the correct status linkage? |
Not contributing to branch status is a feature rather than a bug given how broken our suite 2 tests usually are. As long as it's a known feature I'm fine with it, and I think it's better to keep perf testing the correct commit. |
@DanielRosenwasser filed #37193 with 2 examples that behave strangely with the current definitions. We need to figure out why they behave badly before moving forward with this PR. (Checking the new definitions would be interesting too, but I suspect that they behave the same.) |
This PR hasn't seen any activity for quite a while, so I'm going to close it to keep the number of open PRs manageable. Feel free to open a fresh PR or continue the discussion here. |
Fixes #36327 36327