Title: Constraints cannot be proven in mapped types combination · Issue #13039 · microsoft/TypeScript · GitHub
Open Graph Title: Constraints cannot be proven in mapped types combination · Issue #13039 · microsoft/TypeScript
X Title: Constraints cannot be proven in mapped types combination · Issue #13039 · microsoft/TypeScript
Description: TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161219) Code type A
Open Graph Description: TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161219) Code type A
X Description: TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161219) Code type A<T> = () => T; type B<T, C extends A<T>> = C; type As<Ts> = { [P in keyof Ts]: A<Ts[P]>; }; type...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13039
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Constraints cannot be proven in mapped types combination","articleBody":"**TypeScript Version:** 2.1.4 / nightly (2.2.0-dev.20161219)\r\n\r\n**Code**\r\n\r\n```ts\r\ntype A\u003cT> = () => T;\r\ntype B\u003cT, C extends A\u003cT>> = C;\r\ntype As\u003cTs> = {\r\n [P in keyof Ts]: A\u003cTs[P]>;\r\n};\r\n\r\ntype Failing\u003cTs, Cs extends As\u003cTs>> = {\r\n [P in keyof Ts]: B\u003cTs[P], Cs[P]>;\r\n// ~~~~~ Type 'Cs[P]' does not satisfy the constraint 'A\u003cTs[P]>'.\r\n};\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo errors, the constraint has been proven\r\n\r\n**Actual behavior:**\r\n\r\nError in `Failing` type at `B\u003cTs[P], Cs[P]>`: Type 'Cs[P]' does not satisfy the constraint 'A\u003cTs[P]>'.\r\n\r\n**Note**\r\n\r\nIf I change `A\u003cT>` to be just `T` (`type A\u003cT> = T;`), all compiles just fine.\r\n","author":{"url":"https://github.com/Igorbek","@type":"Person","name":"Igorbek"},"datePublished":"2016-12-20T01:14:41Z","url":"https://github.com/microsoft/TypeScript/issues/13039"}
| 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:b226b9b0-6151-bb0f-76c5-3156bcfd218f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8314:2F4BD9:754184:9D7525:6B00D835 |
| html-safe-nonce | d11fbb10bdb082251b94613ddf9991ebf3d05bd4e16456a9f716aed366ebcb39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzE0OjJGNEJEOTo3NTQxODQ6OUQ3NTI1OjZCMDBEODM1IiwidmlzaXRvcl9pZCI6IjQwMTUzOTY3NzQwMDgxMTczMDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ad25ccff0e1f6cce351f7bd3ac3a444972a6dee7420797a1acba180622cca51a |
| hovercard-subject-tag | issue:196561588 |
| 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/13039/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4cd750aca4ce10766a508396729f49b66f7b8f0190949afa99074ded65b6f70c/microsoft/TypeScript/issues/13039 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4cd750aca4ce10766a508396729f49b66f7b8f0190949afa99074ded65b6f70c/microsoft/TypeScript/issues/13039 |
| og:image:alt | TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161219) Code type A |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Igorbek |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width