Title: Regression in 5.4: Excessive stack depth when comparing recursive type · Issue #57915 · microsoft/TypeScript · GitHub
Open Graph Title: Regression in 5.4: Excessive stack depth when comparing recursive type · Issue #57915 · microsoft/TypeScript
X Title: Regression in 5.4: Excessive stack depth when comparing recursive type · Issue #57915 · microsoft/TypeScript
Description: 🔎 Search Terms "excessive stack depth", "ts2321" 🕗 Version & Regression Information This changed in commit or PR #56004 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.3#code/C4TwDgpgBAShCGATA9gOwDYgCoFczogB4sAaKAOSggA9gJVEB...
Open Graph Description: 🔎 Search Terms "excessive stack depth", "ts2321" 🕗 Version & Regression Information This changed in commit or PR #56004 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.3#code/C4TwDgpgB...
X Description: 🔎 Search Terms "excessive stack depth", "ts2321" 🕗 Version & Regression Information This changed in commit or PR #56004 ⏯ Playground Link https://www.typescriptlang.org/play...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/57915
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression in 5.4: Excessive stack depth when comparing recursive type","articleBody":"### 🔎 Search Terms\n\n\"excessive stack depth\", \"ts2321\"\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR #56004\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play?ts=5.4.3#code/C4TwDgpgBAShCGATA9gOwDYgCoFczogB4sAaKAOSggA9gJVEBnKVHAWwCMIAnMmK2vSZQAgt27wQxAHxQAvFADaAXVlyAUAEgYigOQFUAc2AALXcoF0Gzcuqj2oAfijcEKDCCUA6HzGV2HAC5YNzRMXHwiUgoyRWifLz9pAG51dVBIUXFJAFkAS1RyYjJKGithVk4eNRZ2Lm5LIRsA5zEJKSxpAODSwWsoAAYA+1bsjq6HKGDFBLgkMOw8AmKKaTIEtskZZVT1RAgAY3R4VygAMxxUA+A8tCgTeEYRYAAZBEZgFd7y5kr66QAFAFEPBgPBgnN3JhNuMSAE2AU8mx2D04QBKYIgsFQPLMGH5QpfFJAA\n\n### 💻 Code\n\n```ts\r\ntype ReadonlyTuple\u003cT, N extends number, R extends Array\u003cT> = []> =\r\n\tR['length'] extends N\r\n ? readonly [...R]\r\n : ReadonlyTuple\u003cT, N, [T, ...R]>;\r\n\r\ntype ArrayMinN\u003cT, N extends number> = number extends N\r\n ? Array\u003cT>\r\n : N extends 0\r\n ? Array\u003cT>\r\n : [...ReadonlyTuple\u003cT, N>, ...Array\u003cT>];\r\n\r\ndeclare function hasAtLeast\u003cT, N extends number>(\r\n data: ReadonlyArray\u003cT>,\r\n minimum: N,\r\n): data is ArrayMinN\u003cT, N>;\r\n```\r\n\n\n### 🙁 Actual behavior\n\nThe function `hasAtLeast` does not typecheck, with an error on the return type `data is ArrayMinN\u003cT, N>;`: \"Excessive stack depth comparing types 'ArrayMinN\u003cT, N>' and 'readonly T[]'.(2321)\"\r\n\n\n### 🙂 Expected behavior\n\nNo type error.\n\n### Additional information about the issue\n\nThis was reported in remeda/remeda#572.\r\n\r\nIt's not clear to me whether this is working as intended, though it is a regression. It's not hard to rewrite the type to make it work, but wondering if it's a Deeper Problem™.","author":{"url":"https://github.com/cjquines","@type":"Person","name":"cjquines"},"datePublished":"2024-03-23T00:52:06Z","url":"https://github.com/microsoft/TypeScript/issues/57915"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f907cbd3-26f8-f413-a96d-dfc637a5bc10 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9BA:1CD602:146BBE:1A4DCD:6B04EC0C |
| html-safe-nonce | 10985afc1fad642e1a830ebb4cfdf14039be1cd041e8affffa3ee2eb9205c84a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUJBOjFDRDYwMjoxNDZCQkU6MUE0RENEOjZCMDRFQzBDIiwidmlzaXRvcl9pZCI6IjMzMTg3MDgxODMzMDQwMzk0MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1b8fea885fa7afeb62699fa9043f76edf82b7d46154e33cdd93f7ad8c9868328 |
| hovercard-subject-tag | issue:2203579980 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/57915/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd89fe24947b6d08478ee7eff6170c28e067d371da81ef035339792a2a4cd038/microsoft/TypeScript/issues/57915 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd89fe24947b6d08478ee7eff6170c28e067d371da81ef035339792a2a4cd038/microsoft/TypeScript/issues/57915 |
| og:image:alt | 🔎 Search Terms "excessive stack depth", "ts2321" 🕗 Version & Regression Information This changed in commit or PR #56004 ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.4.3#code/C4TwDgpgB... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cjquines |
| hostname | github.com |
| expected-hostname | github.com |
| None | f3851aad500d8e8dce736722ddc6fa9596e17d9fce3c53581eba968664c0bc32 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e29c922455fd8137f27e1cfcdf6a1e8b920b1926 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width