Title: Intersection type with partial not working · Issue #16251 · microsoft/TypeScript · GitHub
Open Graph Title: Intersection type with partial not working · Issue #16251 · microsoft/TypeScript
X Title: Intersection type with partial not working · Issue #16251 · microsoft/TypeScript
Description: TypeScript Version: 2.2.1 Code export type Transformer
Open Graph Description: TypeScript Version: 2.2.1 Code export type Transformer
X Description: TypeScript Version: 2.2.1 Code export type Transformer<Si> = (name: string) => (s: Array<Instances<Si>>) => Array<any>; export type TransformerConfig<Si> = { [k ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/16251
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Intersection type with partial not working","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n**TypeScript Version:** 2.2.1\r\n\r\n**Code**\r\n\r\n```ts\r\nexport type Transformer\u003cSi> = (name: string) => (s: Array\u003cInstances\u003cSi>>) => Array\u003cany>;\r\nexport type TransformerConfig\u003cSi> = { [k in keyof Si]?: Transformer\u003cSi> };\r\n//export type TransformerConfig\u003cSi> = Partial\u003c{ [k in keyof Si]: Transformer\u003cSi> }>; \u003c-- same result\r\nexport type ToSinksConfig\u003cSi> = { '*': Transformer\u003cSi> } & TransformerConfig\u003cSi>;\r\n//export type ToSinksConfig\u003cSi> = { '*': Transformer\u003cSi> } & TransformerConfig\u003cSi> | { '*': Transformer\u003cSi> }; \u003c-- works\r\nexport type Instances\u003cSi> = { ins: Array\u003cSi> };\r\n\r\nclass Configurator\u003cSi> {\r\n public configure(config: ToSinksConfig\u003cSi> = { '*': n => x => x }): any {\r\n return undefined;\r\n }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nNo errors\r\n\r\n**Actual behavior:**\r\n```\r\ntest.ts(7,22): error TS2322: Type '{ '*': (n: string) => (x: Instances\u003cSi>[]) => Instances\u003cSi>[]; }' is not assignable to type 'ToSinksConfig\u003cSi>'.\r\n Type '{ '*': (n: string) => (x: Instances\u003cSi>[]) => Instances\u003cSi>[]; }' is not assignable to type 'TransformerConfig\u003cSi>'.\r\n```","author":{"url":"https://github.com/jvanbruegge","@type":"Person","name":"jvanbruegge"},"datePublished":"2017-06-04T13:49:17Z","url":"https://github.com/microsoft/TypeScript/issues/16251"}
| 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:5556d54f-6826-1a31-3c0c-ac8123f51505 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9458:2463BD:361953B:451D52C:6B01DD25 |
| html-safe-nonce | 4b97d651b914320a12a9dbc502a7fb5d3aee561d9a7465bdf588da6a6e227288 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDU4OjI0NjNCRDozNjE5NTNCOjQ1MUQ1MkM6NkIwMUREMjUiLCJ2aXNpdG9yX2lkIjoiNTY1OTk5NTA2NjUzMDM4OTI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9b3947f7249cdc1a220b2c3941de3ef75cfe83fce4af74eac5bf605fd79a4de1 |
| hovercard-subject-tag | issue:233434792 |
| 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/16251/issue_layout |
| twitter:image | https://opengraph.githubassets.com/33913b812fc5119720ebdedc1da4c60ccd1e19020789d54e24ac870857a6e910/microsoft/TypeScript/issues/16251 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/33913b812fc5119720ebdedc1da4c60ccd1e19020789d54e24ac870857a6e910/microsoft/TypeScript/issues/16251 |
| og:image:alt | TypeScript Version: 2.2.1 Code export type Transformer |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jvanbruegge |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width