Skip to content
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

Regression in TypeScript 5.4: "Excessive stack depth comparing types" errors #80

Closed
MajorLift opened this issue Mar 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MajorLift
Copy link
Collaborator

MajorLift commented Mar 23, 2024

An unknown breaking change in TypeScript v5.4 is causing errors:

  • The first stable release that triggers this issue is v5.4.2
  • TypeScript version downgraded to v5.3.3 in main branch as a temporary fix: 8843a71
  • All 47 errors are "TS2321: Excessive stack depth comparing types..."
src/natural-number/modulo.ts:15:46 - error TS2321: Excessive stack depth comparing types '_$divide<A_LIST, B_LIST, "MODULO">' and 'readonly Digit[]'.

15   MODULUS_LIST extends DigitList.DigitList = DigitList._$modulo<A_LIST, B_LIST>,
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 47 errors in 10 files.

Errors  Files
     3  src/digit-list/divide.ts:70
     8  src/integer/divide-by.ts:7
     8  src/integer/divide.ts:61
     1  src/integer/modulo.ts:31
     1  src/integer/remainder.ts:22
     8  src/list/range.ts:20
     1  src/list/reverse.ts:30
     8  src/natural-number/divide-by.ts:7
     8  src/natural-number/divide.ts:47
     1  src/natural-number/modulo.ts:15

CI run error log: https://github.com/poteat/hkt-toolbelt/actions/runs/8399043832/job/23004659944

@MajorLift MajorLift added the bug Something isn't working label Mar 23, 2024
MajorLift added a commit that referenced this issue Mar 23, 2024
- TypeScript version range syntax must use tilde instead of caret, as "minor" version bumps correspond to major releases with breaking changes.
- Serves as temporary fix for #80
@MajorLift MajorLift changed the title fix: "Excessive stack depth comparing types" errors caused by TypeScript v5.4 breaking change Regression in TypeScript 5.4: "Excessive stack depth comparing types" errors Mar 23, 2024
@poteat
Copy link
Owner

poteat commented Apr 18, 2024

Fixed by #85

@poteat poteat closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants