Title: Can't partial a generic type with extension constraint · Issue #13442 · microsoft/TypeScript · GitHub
Open Graph Title: Can't partial a generic type with extension constraint · Issue #13442 · microsoft/TypeScript
X Title: Can't partial a generic type with extension constraint · Issue #13442 · microsoft/TypeScript
Description: TypeScript Version: 2.1.5 export function apply
Open Graph Description: TypeScript Version: 2.1.5 export function apply X Description: TypeScript Version: 2.1.5 export function apply<T>(existing: T) { return { changes: (changes: Partial<T>): T => { return null; } }; } function applyVisibility<SectionVisibility, D...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13442
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't partial a generic type with extension constraint","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\nTypeScript Version: 2.1.5\r\n\r\n```\r\nexport function apply\u003cT>(existing: T) {\r\n return {\r\n changes: (changes: Partial\u003cT>): T => {\r\n return null;\r\n }\r\n };\r\n}\r\n\r\nfunction applyVisibility\u003cSectionVisibility, Document extends { sectionVisibility: SectionVisibility }>(document: Document, visibilityUpdates: SectionVisibility): Document {\r\n const sectionVisibility = apply(document.sectionVisibility).changes(visibilityUpdates);\r\n return apply(document).changes({ sectionVisibility: sectionVisibility });\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nCompiles.\r\n\r\n**Actual behavior:**\r\n\r\nDoesn't compile. The type { sectionVisibility: SectionVisibility } is not assignable to Partial\u003cDocument>, despite the fact that we clearly constrained Document to include this property, and it's Partial so we know that every other property is optional.","author":{"url":"https://github.com/markboyall","@type":"Person","name":"markboyall"},"datePublished":"2017-01-12T14:46:08Z","url":"https://github.com/microsoft/TypeScript/issues/13442"}
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:7b6c8087-f116-e8f6-1c34-2c87358620ba current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id B08A:8AE25:F615EA:146DD41:6B01DB15 html-safe-nonce 409d5ee113f2967b304c1acf7d5c9eeffb8305b3f56c9a0e83f07266b115f42b visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDhBOjhBRTI1OkY2MTVFQToxNDZERDQxOjZCMDFEQjE1IiwidmlzaXRvcl9pZCI6IjI3NzIwMjMyMTk0OTI4NzA5MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac b01249e21a4ffe354d7ea603869b88f2ee010a8ac0bf94da8b956482a9d461ab hovercard-subject-tag issue:200385150 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/13442/issue_layout twitter:image https://opengraph.githubassets.com/7ff9288bb01cc1c59c7d55c8cb5bcad6b0d55e0cacd5d00033da1a26f0440de4/microsoft/TypeScript/issues/13442 twitter:card summary_large_image og:image https://opengraph.githubassets.com/7ff9288bb01cc1c59c7d55c8cb5bcad6b0d55e0cacd5d00033da1a26f0440de4/microsoft/TypeScript/issues/13442 og:image:alt TypeScript Version: 2.1.5 export function apply og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username markboyall 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
URLs of crawlers that visited me.