-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Canary: MergeDeep
failures in typescript@next
not detected by canary tests
#784
Canary: MergeDeep
failures in typescript@next
not detected by canary tests
#784
Comments
The regression should be caused by any of the following commits: Rather, as |
Suggested to add |
FWIW you can pretty easily bisect this using every-ts: https://www.npmjs.com/package/every-ts $ every-ts fetch
$ every-ts bisect bad 5.4.0-dev.20231121
$ every-ts bisect good 5.4.0-dev.20231119
$ every-ts tsc
$ every-ts bisect bad
$ every-ts tsc
$ every-ts bisect good
... |
Finally got time to look into this and Came to the conclusion that its microsoft/TypeScript#56004 that caused these errors |
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
* 👷 Update all non-major dependencies * fix a typescript 5.4.2 regression causing typechecking to fail See: * sindresorhus/type-fest#784 * mantinedev/mantine#5891 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
Bump `type-fest` to `^4.12.0` for typescript v5.4 compatibility, avoiding sindresorhus/type-fest#784 Refs STTYPES-11
Bump `type-fest` to `^4.12.0` for typescript v5.4 compatibility, avoiding sindresorhus/type-fest#784 Refs STTYPES-11
Fixes sindresorhus/type-fest#784 manifestation.
Fixes sindresorhus/type-fest#784 manifestation.
I'm seeing a lot of these style of errors in the canary tests in my own modules:
I didn't receive them in
typescript@5.4.0-dev.20231119
then started receiving them intypescript@5.4.0-dev.20231121
.To avoid a regression once
typescript@5.4.0
gets launched, we should track down the cause of this and file an issue withtypescript
if needed.We should also track down why the canary tests in
type-fest
itself isn't catching it.Upvote & Fund
The text was updated successfully, but these errors were encountered: