Skip to content

rewrite recursive conditional types to be tail-recursive#256

Draft
DetachHead wants to merge 9 commits into
millsp:masterfrom
DetachHead:master
Draft

rewrite recursive conditional types to be tail-recursive#256
DetachHead wants to merge 9 commits into
millsp:masterfrom
DetachHead:master

Conversation

@DetachHead

@DetachHead DetachHead commented Oct 4, 2021

Copy link
Copy Markdown

🎁 Pull Request

  • Used a clear / meaningful title for this pull request
  • Tested the changes in your own code (on your projects)
  • Added / Edited tests to reflect changes (tests folder)
  • Have read the Contributing part of the Readme
  • Passed npm test (there were tests failing before i made my changes, i don't think i introduced any new failures)

Fixes

closes #255

Why have you made changes?

in typescript 4.5, tail-recursive conditional types are now optimized such that the recursion limit can be much higher (1000) instead of 100. see the blog post and microsoft/TypeScript#45711

What changes have you made?

IterationMap
  • increased its range to -1000 to 1000
  • added script to make updating the range easier ./scripts/tools/update-IterationMap.ts
rewrote types to be tail-recursive
  • String/Join
  • List/Flatten
  • List/Take
  • Any/Compute
  • Community/IncludesDeep
  • Function/AutoPath

What tests have you updated?

  • tests/String.ts

Is there any breaking changes?

  • Yes, I changed the public API & documented it
  • Yes, I changed existing tests
  • No, I added to the public API & documented it
  • No, I added to the existing tests
  • I don't know

Anything else worth mentioning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rewrite recursive conditional types to be tail-recursive

1 participant