Title: When the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element. · Issue #56885 · microsoft/TypeScript · GitHub
Open Graph Title: When the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element. · Issue #56885 · microsoft/TypeScript
X Title: When the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element. · Issue #56885 · microsoft/TypeScript
Description: 🔍 Search Terms initial element of the tuple is a rest element ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of existing JavaScript code This coul...
Open Graph Description: 🔍 Search Terms initial element of the tuple is a rest element ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavi...
X Description: 🔍 Search Terms initial element of the tuple is a rest element ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtim...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/56885
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element.","articleBody":"### 🔍 Search Terms\n\ninitial element of the tuple is a rest element\n\n### ✅ Viability Checklist\n\n- [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code\n- [X] This wouldn't change the runtime behavior of existing JavaScript code\n- [X] This could be implemented without emitting different JS based on the types of the expressions\n- [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\n- [X] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types\n- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals\n\n### ⭐ Suggestion\n\n```ts\r\ntype T1 = [...string[], number, boolean]\r\n\r\ndeclare const head: T1[0]\r\n // Actual: string | number | boolean\r\n // Expected: string | number\r\n```\n\n### 📃 Motivating Example\n\n-\n\n### 💻 Use Cases\n\n[https://github.com/microsoft/TypeScript/issues/56883](https://github.com/microsoft/TypeScript/issues/56883)","author":{"url":"https://github.com/13OnTheCode","@type":"Person","name":"13OnTheCode"},"datePublished":"2023-12-27T12:09:08Z","url":"https://github.com/microsoft/TypeScript/issues/56885"}
| 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:8949a10f-4d36-cc2a-fd9e-68174ce25edf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A02C:323204:78ACC4:9F9668:6B01AB5F |
| html-safe-nonce | 628334ffa23732c3ecd61b0184a849f17ef3a5a6315a4ad46527f0af87d61c2c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDJDOjMyMzIwNDo3OEFDQzQ6OUY5NjY4OjZCMDFBQjVGIiwidmlzaXRvcl9pZCI6IjQ3MjU1MDQ3MzY2MjU3OTc5ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 01d1f2d06b4845d721fcc5542a9cee61dd4903d2c79b1ff5291e6712f4482793 |
| hovercard-subject-tag | issue:2057299239 |
| 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/56885/issue_layout |
| twitter:image | https://opengraph.githubassets.com/347c5cfa7572891b3325d5a8c8bb863e94b75960834a682c1cdf31690e19478c/microsoft/TypeScript/issues/56885 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/347c5cfa7572891b3325d5a8c8bb863e94b75960834a682c1cdf31690e19478c/microsoft/TypeScript/issues/56885 |
| og:image:alt | 🔍 Search Terms initial element of the tuple is a rest element ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 13OnTheCode |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width