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 #56883 · 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 #56883 · 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 #56883 · microsoft/TypeScript
Description: 🔎 Search Terms initial element of the tuple is a rest element 🕗 Version & Regression Information ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAKgjFAvFA2gOgwZ2AJwJYB2A5igLoA0UBArgLYBGEOl9A9qwDYQCGBpAsACghAE...
Open Graph Description: 🔎 Search Terms initial element of the tuple is a rest element 🕗 Version & Regression Information ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAKgjFAvFA2gOgwZ2AJwJYB2...
X Description: 🔎 Search Terms initial element of the tuple is a rest element 🕗 Version & Regression Information ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAKgjFAvFA2gOgwZ2AJw...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/56883
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### 🕗 Version & Regression Information\n\n-\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAKgjFAvFA2gOgwZ2AJwJYB2A5igLoA0UBArgLYBGEOl9A9qwDYQCGBpAsACghAEwgBjDtxzRxrAtijScALlhwhQuQuBQAFjxFIlOHCgAMAwVBsB6W1AB6AfiE2o9qAFEAHpHHAECJq2PjEUAA+VHSMOEA\n\n### 💻 Code\n\n```ts\r\ntype T1 = [...string[], number, boolean]\r\n\r\ndeclare const arr: T1\r\n\r\nconst head = arr[0]\r\n // Actual: string | number | boolean\r\n // Expected: string | number\r\n```\r\n\n\n### 🙁 Actual behavior\n\nWhen the initial element of the tuple is a rest element, it is not possible to correctly infer the type of the initial element.\n\n### 🙂 Expected behavior\n\nInfer the correct type.\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/13OnTheCode","@type":"Person","name":"13OnTheCode"},"datePublished":"2023-12-26T19:55:46Z","url":"https://github.com/microsoft/TypeScript/issues/56883"}
| 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:5aa5ff93-a8f1-4641-877c-c35a4b17463c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DDDC:8AE25:75E50C:9C3D48:6B01AB8F |
| html-safe-nonce | 2374a7fefe0da5670d508ac57fb731edc366ef7338f95ef9dcda546d215e19e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERERDOjhBRTI1Ojc1RTUwQzo5QzNENDg6NkIwMUFCOEYiLCJ2aXNpdG9yX2lkIjoiNTMzNTUwMzk1NjUzNTc4MjI4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bd061753cbdecbf3def2802aa03b460a04fa0bde3c4d0a7ca010883503632fe2 |
| hovercard-subject-tag | issue:2056669360 |
| 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/56883/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfacb142591d1b379636c72d4d15969b1ee43e9ef695e335c7abdbc8b85dc6c6/microsoft/TypeScript/issues/56883 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfacb142591d1b379636c72d4d15969b1ee43e9ef695e335c7abdbc8b85dc6c6/microsoft/TypeScript/issues/56883 |
| og:image:alt | 🔎 Search Terms initial element of the tuple is a rest element 🕗 Version & Regression Information ⏯ Playground Link https://www.typescriptlang.org/play?ts=5.3.2#code/C4TwDgpgBAKgjFAvFA2gOgwZ2AJwJYB2... |
| 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