Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After the change in microsoft/TypeScript#56004 the `PickRestType` was causing some types to be considered theoretically infinite in their recursion. I can't wrap my mind around exactly why right now, but I can see how `PickRestType` on a crazy long tuple will cause a very deep recursion, so I decided to simply cap its recursion and return `unknown[]` if it goes past that point and that solved the errors. Side effects: - In practice: rarely any I believe - In theory: some merged types will regress to `unknown[]` in TypeScript versions older than 5.4 Considerations: Is the `DepthTracker extends Array<true> = []` + `PickRestTypeMaxDepth extends DepthTracker['length']` a good way to track depth? I know I have done a depth check previous times but can't remember what solution I picked then. Fixes #784
- Loading branch information