-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Defer processing of nested generic calls that return constructor types #54813
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
Defer processing of nested generic calls that return constructor types #54813
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
2f8d596
to
8a8b22e
Compare
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.
IMO, what's good for the generic function is good for the generic constructor - it being missing was probably just an oversight.
@typescript-bot test this |
Heya @weswigham, I've started to run the regular perf test suite on this PR at e0a1e0d. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at e0a1e0d. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the diff-based top-repos suite on this PR at e0a1e0d. You can monitor the build here. Update: The results are in! |
@weswigham Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@weswigham Here are the results of running the top-repos suite comparing Everything looks good! |
Hey @weswigham, it looks like the DT test run failed. Please check the log for more details. |
@tyescript-bot run dt |
@typescript-bot run dt |
Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at fd34565. You can monitor the build here. Update: The results are in! |
Hey @sandersn, the results of running the DT tests are ready. |
…tor types (microsoft#54813)" This reverts commit 8d1fa44.
I'm trying a lot of things to benefit from contextual inference like this for nested calls. The only thing that works is if the nested call returns a function but at that position in our library regular functions can also one received.
We need a way between differentiating them at runtime so I tried to return a constructable type from our factories instead - that didn't pan out. It didn't help my inference problems but I was quickly able to find out why... so I tried this as an experiment and since all tests pass, I think it's worth proposing this.