-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Ignore self tail calls when collecting the return type of a function #53995
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
@typescript-bot test this |
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite (tsserver) on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite (tsserver) on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at b0f4ad7. You can monitor the build here. |
Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at b0f4ad7. You can monitor the build here. |
Heya @RyanCavanaugh, I've started to run the perf test suite on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the parallelized Definitely Typed test suite on this PR at b0f4ad7. You can monitor the build here. Update: The results are in! |
Hey @RyanCavanaugh, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running |
@RyanCavanaugh Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
Heya @RyanCavanaugh, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
This looks great! Should be able to remove quite a few unnecessary explicit return signatures 😊 |
@RyanCavanaugh Here are the results of running the user test suite comparing Everything looks good! |
Inferring |
Question: What happens here? function foo() {
return bar(); // not mutually recursive
} Nothing in the OP suggests this is only for self-recursive functions, so I want to check. |
Just an imprecise title; this is only about self-recursive tail calls to the same function as the one being checked. So this doesn't enable automatic checking of e.g. mutual recursion either |
@RyanCavanaugh Here they are:
CompilerComparison Report - main..53995
System
Hosts
Scenarios
TSServerComparison Report - main..53995
System
Hosts
Scenarios
StartupComparison Report - main..53995
System
Hosts
Scenarios
Developer Information: |
@RyanCavanaugh Here are the results of running the top-repos suite comparing Everything looks good! |
Hey @RyanCavanaugh, the results of running the DT tests are ready. |
@typescript-bot pack this |
Heya @jakebailey, I've started to run the tarball bundle task on this PR at b0f4ad7. You can monitor the build here. |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@RyanCavanaugh Here are the results of running the top-repos suite comparing Everything looks good! |
@RyanCavanaugh is this PR also can be resolved for generator function? |
Fixes longstanding complaints about simple recursive functions!
When you have a recursive function with a base case and a self-recursive tail call, there's no reason we can't correctly handle it. With this PR:
and
I believe the blocker we had to doing this originally was the lack of a
never
type, but now we have that, it's straightforward to do this and everything just sort of works out.