Title: Supporting generic type inference over the other higher-order functions · Issue #9366 · microsoft/TypeScript · GitHub
Open Graph Title: Supporting generic type inference over the other higher-order functions · Issue #9366 · microsoft/TypeScript
X Title: Supporting generic type inference over the other higher-order functions · Issue #9366 · microsoft/TypeScript
Description: Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it will be called. function flip(f: ...
Open Graph Description: Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it wi...
X Description: Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it wi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9366
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Supporting generic type inference over the other higher-order functions","articleBody":"Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it will be called.\r\n\r\n``` ts\r\nfunction flip\u003ca, b, c\u003e(f: (a: a, b: b) =\u003e c): (b: b, a: a) =\u003e c {\r\n return (b: b, a: a) =\u003e f(a, b);\r\n}\r\nfunction zip\u003cT, U\u003e(x: T, y: U): [T, U] {\r\n return [x, y];\r\n}\r\nvar expected: \u003cT, U\u003e(y: U, x: T) =\u003e [T, U] = flip(zip);\r\nvar actual: (y: {}, x: {}) =\u003e [{}, {}] = flip(zip);\r\n```\r\n","author":{"url":"https://github.com/falsandtru","@type":"Person","name":"falsandtru"},"datePublished":"2016-06-26T22:31:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/9366/TypeScript/issues/9366"}
| 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:76270386-c46c-ddda-f730-e5a26a1c9fe3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D3A:2F4309:1E2652:2CD254:6A61E149 |
| html-safe-nonce | 51052fdf48e121fd68c4aa30644ae6023ae868ca9af0de9e130ca96e6ef3d092 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDNBOjJGNDMwOToxRTI2NTI6MkNEMjU0OjZBNjFFMTQ5IiwidmlzaXRvcl9pZCI6IjE0NzI2OTM4OTkwMjY4ODI4OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d374d401b2a45c2b98e52727800801055b471200f7679f5f76d8ee4541533236 |
| hovercard-subject-tag | issue:162351308 |
| 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/9366/issue_layout |
| twitter:image | https://opengraph.githubassets.com/88f85396fe5d1b13bca2ee181ff2f76e0c0af69b43e4cf740eb05ab064e56667/microsoft/TypeScript/issues/9366 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/88f85396fe5d1b13bca2ee181ff2f76e0c0af69b43e4cf740eb05ab064e56667/microsoft/TypeScript/issues/9366 |
| og:image:alt | Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it wi... |
| 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 | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| 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 | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width