Title: Union tuple type in rest argument can't accpect less argument. · Issue #48663 · microsoft/TypeScript · GitHub
Open Graph Title: Union tuple type in rest argument can't accpect less argument. · Issue #48663 · microsoft/TypeScript
X Title: Union tuple type in rest argument can't accpect less argument. · Issue #48663 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms source has but target allows only 🕗 Version & Regression Information This is a crash ⏯ Playground Link Playground link with relevant code 💻 Code const func: (...args: [number, string] | [string, number]) => void...
Open Graph Description: Bug Report 🔎 Search Terms source has but target allows only 🕗 Version & Regression Information This is a crash ⏯ Playground Link Playground link with relevant code 💻 Code const func: (...args: [num...
X Description: Bug Report 🔎 Search Terms source has but target allows only 🕗 Version & Regression Information This is a crash ⏯ Playground Link Playground link with relevant code 💻 Code const func: (...args: ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/48663
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Union tuple type in rest argument can't accpect less argument.","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n-->\r\n\r\n### 🔎 Search Terms\r\nsource has but target allows only\r\n\u003c!--\r\n What search terms did you use when trying to find an existing bug report?\r\n List them here so people in the future can find this one more easily.\r\n-->\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n\u003c!-- When did you start seeing this bug occur?\r\n\r\n\"Bugs\" that have existed in TS for a long time are very likely to be FAQs; refer to\r\n https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs\r\n\r\nIf possible, please try testing the nightly version of TS to see if it's already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n\r\nNote: The TypeScript Playground can be used to try older versions of TypeScript.\r\n\r\nPlease keep and fill in the line that best applies:\r\n-->\r\n- This is a crash\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/FAYw9gdgzgLgBAMwK4RALjgCgHS4IYBOA5lBgNoRIC2ARgKYEA0csBAlhEQLpwA+cZVhyLNKtBlwCUcALwA+OADcwbACaysbGHSrT5cAN5wAvkA)\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well-->\r\n```ts\r\nconst func: (...args: [number, string] | [string, number]) => void = (item) => { }\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nthrow error \r\n```\r\nType '(item: string | number) => void' is not assignable to type '(...args: [number, string] | [string, number]) => void'.\r\n Types of parameters 'item' and 'args' are incompatible.\r\n Type '[number, string] | [string, number]' is not assignable to type '[item: string | number]'.\r\n Type '[number, string]' is not assignable to type '[item: string | number]'.\r\n Source has 2 element(s) but target allows only 1.\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\nno error\r\n","author":{"url":"https://github.com/takanara1994","@type":"Person","name":"takanara1994"},"datePublished":"2022-04-13T09:11:32Z","url":"https://github.com/microsoft/TypeScript/issues/48663"}
| 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:7e89a099-ac99-4bd6-69bc-6985453fe670 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A392:AF327:AA485:EDBC3:6B0462EF |
| html-safe-nonce | da0ff736759ce7a79b8ad22086ebdcc3fd6be56308729df2357196ff0b755b35 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzkyOkFGMzI3OkFBNDg1OkVEQkMzOjZCMDQ2MkVGIiwidmlzaXRvcl9pZCI6IjYwNzc3MTY3ODI1MTEzMTc3NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e2260ee5619e4a3c19d6c9878b615cc58e767a82cea30a640af176016e45d4f9 |
| hovercard-subject-tag | issue:1203020016 |
| 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/48663/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f7b6ec9ac9606286fc9faa2e3e1dc59f2690d5efc8283c966b423639d1f401ef/microsoft/TypeScript/issues/48663 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f7b6ec9ac9606286fc9faa2e3e1dc59f2690d5efc8283c966b423639d1f401ef/microsoft/TypeScript/issues/48663 |
| og:image:alt | Bug Report 🔎 Search Terms source has but target allows only 🕗 Version & Regression Information This is a crash ⏯ Playground Link Playground link with relevant code 💻 Code const func: (...args: [num... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | takanara1994 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| 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 | 03e114520787ad27289207f153520ef97461127c |
| 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