Title: Tuple union types incorrectly infer never type · Issue #22562 · microsoft/TypeScript · GitHub
Open Graph Title: Tuple union types incorrectly infer never type · Issue #22562 · microsoft/TypeScript
X Title: Tuple union types incorrectly infer never type · Issue #22562 · microsoft/TypeScript
Description: separated from #22432 TypeScript Version: 2.7.0-dev.20180307 Search Terms: Code type C
Open Graph Description: separated from #22432 TypeScript Version: 2.7.0-dev.20180307 Search Terms: Code type C
X Description: separated from #22432 TypeScript Version: 2.7.0-dev.20180307 Search Terms: Code type C<R> = [R[]] | [R[], void]; declare function h<T>(f: C<T>): void; h([[]] as [never[]]); // T: ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22562
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tuple union types incorrectly infer never type","articleBody":"separated from #22432\r\n\r\n**TypeScript Version:** 2.7.0-dev.20180307\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** \r\n\r\n**Code**\r\n\r\n```ts\r\ntype C\u003cR> = [R[]] | [R[], void];\r\ndeclare function h\u003cT>(f: C\u003cT>): void;\r\nh([[]] as [never[]]); // T: never[]\r\nh([[]] as [void[]]); // T: void\r\n```\r\n\r\n**Expected behavior:**\r\n\r\n```ts\r\nh([[]] as [never[]]); // T: never\r\nh([[]] as [void[]]); // T: void\r\n```\r\n\r\n**Actual behavior:**\r\n\r\n```ts\r\nh([[]] as [never[]]); // T: never[]\r\nh([[]] as [void[]]); // T: void\r\n```\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> \r\n\r\n**Related Issues:**\r\n","author":{"url":"https://github.com/falsandtru","@type":"Person","name":"falsandtru"},"datePublished":"2018-03-14T09:17:39Z","url":"https://github.com/microsoft/TypeScript/issues/22562"}
| 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:c89fefa3-ced6-e467-b620-23d9e767c1c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEA2:172B92:BC982B:FD7565:6B00F771 |
| html-safe-nonce | de24551261ab9eeb8fa10e4e99e6ee894b7603abc78db1e0d6e63236e46b6855 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUEyOjE3MkI5MjpCQzk4MkI6RkQ3NTY1OjZCMDBGNzcxIiwidmlzaXRvcl9pZCI6IjkyMDQ1MTI1NTgwODAzOTEwMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ba17b667aa99cfaa90eb81bc4528adcdb086dbf3f191e6217080ede1d58e7ddf |
| hovercard-subject-tag | issue:305077169 |
| 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/22562/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e51b91c8e376826e3da12a37d1e0c095609b4d820e3effcc3e2b8652b41002a/microsoft/TypeScript/issues/22562 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e51b91c8e376826e3da12a37d1e0c095609b4d820e3effcc3e2b8652b41002a/microsoft/TypeScript/issues/22562 |
| og:image:alt | separated from #22432 TypeScript Version: 2.7.0-dev.20180307 Search Terms: Code type C |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | falsandtru |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width