Title: Generics not being inferred in complex case · Issue #9107 · microsoft/TypeScript · GitHub
Open Graph Title: Generics not being inferred in complex case · Issue #9107 · microsoft/TypeScript
X Title: Generics not being inferred in complex case · Issue #9107 · microsoft/TypeScript
Description: TypeScript Version: Typescript playground Code const compose =
Open Graph Description: TypeScript Version: Typescript playground Code const compose =
X Description: TypeScript Version: Typescript playground Code const compose = <In, Intermediate_Big, Intermediate_Small extends Intermediate_Big, Out>(f: (x: In)=> Intermediate_Small, g: (x: Intermediate...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9107
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generics not being inferred in complex case","articleBody":"\u003c!--\nThank you for contributing to TypeScript! Please review this checklist\n before submitting your issue.\n[ ] Many common issues and suggestions are addressed in the FAQ\n https://github.com/Microsoft/TypeScript/wiki/FAQ\n[ ] Search for duplicates before logging new issues\n https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue\n[ ] Questions are best asked and answered at Stack Overflow\n http://stackoverflow.com/questions/tagged/typescript\n\nFor bug reports, please include the information below.\n__________________________________________________________ -->\n\n**TypeScript Version:** \n\nTypescript playground\n\n**Code**\n\n``` ts\nconst compose = \u003cIn, Intermediate_Big, Intermediate_Small extends Intermediate_Big, Out>(f: (x: In)=> Intermediate_Small, g: (x: Intermediate_Big) => Out): (a1: In) => Out => (_ => g(f(_)))\nconst first = \u003cT>(a: T[]): T => a[0]\nconst getText = (_: HTMLElement) => _.innerText\nconst c = compose(first, getText)\n\n```\n\n**Expected behavior:**\nc is of type `(x: HTMLElement[]) => string`\n**Actual behavior:** \nc is of type `(x: {}) => string`\n","author":{"url":"https://github.com/michaelmesser","@type":"Person","name":"michaelmesser"},"datePublished":"2016-06-12T17:10:38Z","url":"https://github.com/microsoft/TypeScript/issues/9107"}
| 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:3c628775-755c-7ac1-6396-947b6b387678 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7FC:3F8AB1:E4888D:12573B6:6B00F5C9 |
| html-safe-nonce | 5dab0a25c138a11c1f74162be42b26a0253afedab5229689c1dd470aa15aa744 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0ZDOjNGOEFCMTpFNDg4OEQ6MTI1NzNCNjo2QjAwRjVDOSIsInZpc2l0b3JfaWQiOiI2MDQ4NTEzMDA2MzUzMDUzMTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 17c4dd5cc74c310677c5f3ddc208f9219508bb8bfacf4b46711c600e4afdfbc6 |
| hovercard-subject-tag | issue:159837437 |
| 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/9107/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b71e2bda83cfe38102b1c9ea169761eb1a191833ff91de35e1ce73975329299f/microsoft/TypeScript/issues/9107 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b71e2bda83cfe38102b1c9ea169761eb1a191833ff91de35e1ce73975329299f/microsoft/TypeScript/issues/9107 |
| og:image:alt | TypeScript Version: Typescript playground Code const compose = |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | michaelmesser |
| 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