Title: Can extends [any, any] but not generic which is exactly [any, any] (woks till 5.3.3 breaks from 5.4.5) · Issue #60299 · microsoft/TypeScript · GitHub
Open Graph Title: Can extends [any, any] but not generic which is exactly [any, any] (woks till 5.3.3 breaks from 5.4.5) · Issue #60299 · microsoft/TypeScript
X Title: Can extends [any, any] but not generic which is exactly [any, any] (woks till 5.3.3 breaks from 5.4.5) · Issue #60299 · microsoft/TypeScript
Description: 🔎 Search Terms generic, tuple extends 🕗 Version & Regression Information This code works in the playground with typescript version 5.3.3 but breaks since version 5.4.5 (version between are not available in the playground) ⏯ Playground Li...
Open Graph Description: 🔎 Search Terms generic, tuple extends 🕗 Version & Regression Information This code works in the playground with typescript version 5.3.3 but breaks since version 5.4.5 (version between are not avai...
X Description: 🔎 Search Terms generic, tuple extends 🕗 Version & Regression Information This code works in the playground with typescript version 5.3.3 but breaks since version 5.4.5 (version between are not ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/60299
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can extends [any, any] but not generic which is exactly [any, any] (woks till 5.3.3 breaks from 5.4.5)","articleBody":"### 🔎 Search Terms\n\ngeneric, tuple extends\n\n### 🕗 Version \u0026 Regression Information\n\nThis code works in the playground with typescript version 5.3.3 but breaks since version 5.4.5 (version between are not available in the playground)\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?ts=5.6.3#code/C4TwDgpgBAIghsOUC8UDacBcUCMAaKAI2wCYCA6SgY2wGY0BdBgWACg3RIoAVCAZ2DdwEHAB5uUCAA9gEAHYATPlDhyQjAHwoobKHp6SZ8pekrkAlnIBmEAE5QASodmLlGNQVUgGFSl8YMUAD8jlDYchAAbnYcwlCyAjjavAJCkGLwiBpsAPQ5+gB6QWyxXCmCwiTizsbK-j5QALJwfADWNa4qaoza7iCeagxaqLr6EtIuJmhmljb2ThO1TS2tvuT1gSFO4VExrJzQCcAkyfwVkFWZcNmseYVBQA\n\n### 💻 Code\n\n```ts\ntype Data = [a: 1, b: 2, ...c: 3[]]\n\ntype TestType1\u003cT extends any[]\u003e = \n T extends [...infer R extends [any, any], ...any[]] ? R : never\ntype test1 = TestType1\u003cData\u003e\n// ^?\n\ntype TestType2\u003cT extends any[], Mask extends any[] = [any, any]\u003e = \n T extends [...infer R extends Mask, ...any[]] ? R : never\ntype test2 = TestType2\u003cData\u003e\n// ^?\n```\n\n\n### 🙁 Actual behavior\n\nWhen passing the `Mask ` as a generic and trying to extends the tuple with it to extract the relevant part, the resulting tuple is well formed, but item types are replaced with `any`\n\n### 🙂 Expected behavior\n\nExpect that constraint on infer to works wether as an explicit form or a generic holding a type with the exact same form, which used to be the case priori to typescript 5.4 bu breaks since\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/zedryas","@type":"Person","name":"zedryas"},"datePublished":"2024-10-21T15:13:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/60299/TypeScript/issues/60299"}
| 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:244171e2-78d2-30bf-4b03-db27bb0813ad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5E0:B1596:30BE10:464F64:6A61E3A5 |
| html-safe-nonce | 6127e9c907a534bff133a1db804f20c94a9efad64c2ac67077a4133a6f5086d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUUwOkIxNTk2OjMwQkUxMDo0NjRGNjQ6NkE2MUUzQTUiLCJ2aXNpdG9yX2lkIjoiMjk3Mzc3MTgzNDk2ODg5MjMyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ace85f369e3cb3ea3c657b14e77709fd93177e6098010a2c6ee750b7518c40e |
| hovercard-subject-tag | issue:2602868871 |
| 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/60299/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72966f85177c0cc48465656ae6aea1f306d41a744288617f7698d6546f611ec2/microsoft/TypeScript/issues/60299 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72966f85177c0cc48465656ae6aea1f306d41a744288617f7698d6546f611ec2/microsoft/TypeScript/issues/60299 |
| og:image:alt | 🔎 Search Terms generic, tuple extends 🕗 Version & Regression Information This code works in the playground with typescript version 5.3.3 but breaks since version 5.4.5 (version between are not avai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zedryas |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| 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 | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width