Title: Inference breaks when a function returns a tuple with another function · Issue #44476 · microsoft/TypeScript · GitHub
Open Graph Title: Inference breaks when a function returns a tuple with another function · Issue #44476 · microsoft/TypeScript
X Title: Inference breaks when a function returns a tuple with another function · Issue #44476 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms Inference, tuple, generic, callback, higher-order function 🕗 Version & Regression Information v4.3.2 and below (tested down to v3.3.3) ⏯ Playground Link Playground link with relevant code 💻 Code declare function...
Open Graph Description: Bug Report 🔎 Search Terms Inference, tuple, generic, callback, higher-order function 🕗 Version & Regression Information v4.3.2 and below (tested down to v3.3.3) ⏯ Playground Link Playground link wi...
X Description: Bug Report 🔎 Search Terms Inference, tuple, generic, callback, higher-order function 🕗 Version & Regression Information v4.3.2 and below (tested down to v3.3.3) ⏯ Playground Link Playground lin...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/44476
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inference breaks when a function returns a tuple with another function","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\nInference, tuple, generic, callback, higher-order function\r\n\r\n### 🕗 Version \u0026 Regression Information\r\n\r\nv4.3.2 and below (tested down to v3.3.3)\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEEkDsDMFMCdaQMa1AI0QQwNYGdQB3ACyVGgFcUAXASwHtJRFqL5IDWAHAGzUNrVioLJHpCE5KsjqMAUHIAmsZDyyIpNBkywAKAJQAuUAG05oUAB4AKgD5d6gObHr+0AF5boa3IC6C5VV1NEotRgwbABpQAFV7LABGF2isACZjEwcXN09Y3yNYhXRdBOiTPX0TAAZffNAQZlhWdgJICgBbdAQUglgADy4ValhFOWLSkQM3BpY2DlAqHDFCJl1+wZkRkVA2zoR9OSA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\ndeclare function a(): [\r\n \u003cT\u003e(arg: T) =\u003e T\r\n]\r\n\r\ndeclare function b\u003cT, U\u003e(a1: T, a2: [(a: T) =\u003e U]): U\r\n\r\nb(1, [a()[0]]) // returns number, as expected\r\nb(1, a()) // returns unknown (expected a number)\r\n```\r\n","author":{"url":"https://github.com/vitalyq","@type":"Person","name":"vitalyq"},"datePublished":"2021-06-07T06:29:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/44476/TypeScript/issues/44476"}
| 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:f05a63b8-ce23-edc4-ed50-53c55d5cb632 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACE6:11F254:4C98F6:6CDE3D:6A630C8A |
| html-safe-nonce | a6fa21b52f0fcbbf382baf4c49040c1b069b71ebe9b1005cc808b41d61d305b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0U2OjExRjI1NDo0Qzk4RjY6NkNERTNEOjZBNjMwQzhBIiwidmlzaXRvcl9pZCI6IjQ2NzM0MzYwMjM0NTIyNzM4MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81c3c728f75156f4915cc8a61f04d7cb3d3b41b6ad88a0c74aa7cb34406cb166 |
| hovercard-subject-tag | issue:913156751 |
| 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/44476/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e4c7b57d670edca85bb2b791ef678518b14334cde3922067d2c9693f36ca6e36/microsoft/TypeScript/issues/44476 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e4c7b57d670edca85bb2b791ef678518b14334cde3922067d2c9693f36ca6e36/microsoft/TypeScript/issues/44476 |
| og:image:alt | Bug Report 🔎 Search Terms Inference, tuple, generic, callback, higher-order function 🕗 Version & Regression Information v4.3.2 and below (tested down to v3.3.3) ⏯ Playground Link Playground link wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vitalyq |
| hostname | github.com |
| expected-hostname | github.com |
| None | b48e7bf0b1945d51f303503b057abf666ce74c3efbe107b413db2bb921c3f012 |
| 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 | 9370f37042c29822d6ba7e3f670f0036a0155b21 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width