Title: Unexpected error when using generic with Pick and Exclude · Issue #28748 · microsoft/TypeScript · GitHub
Open Graph Title: Unexpected error when using generic with Pick and Exclude · Issue #28748 · microsoft/TypeScript
X Title: Unexpected error when using generic with Pick and Exclude · Issue #28748 · microsoft/TypeScript
Description: TypeScript Version: 3.2.1 Search Terms: generic pick exclude Code // // Example 1 // const fn = Open Graph Description: TypeScript Version: 3.2.1 Search Terms: generic pick exclude Code // // Example 1 // const fn = X Description: TypeScript Version: 3.2.1 Search Terms: generic pick exclude Code // // Example 1 // const fn = <Params extends {}>( params: Pick<Params, Exclude<keyof Params, never>>, ): Params ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28748
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected error when using generic with Pick and Exclude","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n--\u003e\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --\u003e\r\n**TypeScript Version:** 3.2.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) --\u003e\r\n**Search Terms:** generic pick exclude\r\n\r\n**Code**\r\n\r\n``` ts\r\n//\r\n// Example 1\r\n//\r\n\r\nconst fn = \u003cParams extends {}\u003e(\r\n params: Pick\u003cParams, Exclude\u003ckeyof Params, never\u003e\u003e,\r\n): Params =\u003e\r\n // Unexpected error\r\n /* Type 'Pick\u003cParams, Exclude\u003ckeyof Params, never\u003e\u003e' is not assignable to type 'Params'. */\r\n params;\r\n\r\n//\r\n// Example 2\r\n//\r\n\r\nimport * as React from 'react';\r\nimport { ComponentType, FunctionComponent } from 'react';\r\n\r\ntype User = { name: string };\r\ntype UserProp = { user: User };\r\n\r\nexport const myHoc = function\u003cComposedComponentProps extends UserProp\u003e(\r\n ComposedComponent: ComponentType\u003cComposedComponentProps\u003e,\r\n) {\r\n // These two should be equivalent, but they're not?\r\n // Doesn't work:\r\n type Props = Pick\u003c\r\n ComposedComponentProps,\r\n Exclude\u003ckeyof ComposedComponentProps, never\u003e\r\n \u003e;\r\n // Works:\r\n // type Props = ComposedComponentProps;\r\n\r\n const Component: FunctionComponent\u003cProps\u003e = props =\u003e (\r\n // Unexpected error\r\n /* Type 'PropsWithChildren\u003cPick\u003cComposedComponentProps, Exclude\u003ckeyof ComposedComponentProps, never\u003e\u003e\u003e' is not assignable to type 'IntrinsicAttributes \u0026 ComposedComponentProps \u0026 { children?: ReactNode; }'.\r\n Type 'PropsWithChildren\u003cPick\u003cComposedComponentProps, Exclude\u003ckeyof ComposedComponentProps, never\u003e\u003e\u003e' is not assignable to type 'ComposedComponentProps'. */\r\n \u003cComposedComponent {...props} /\u003e\r\n );\r\n\r\n return Component;\r\n};\r\n```","author":{"url":"https://github.com/OliverJAsh","@type":"Person","name":"OliverJAsh"},"datePublished":"2018-11-29T22:48:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":21},"url":"https://github.com/28748/TypeScript/issues/28748"}
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:9c686705-a139-8f89-1bc5-7e32b75d625c current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 8714:29DF63:611FAF:83A983:6A627C43 html-safe-nonce eab0831aa5798d18b73f51828d3823c57d0b6f5425aa06d5da6e74c48fb0548d visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzE0OjI5REY2Mzo2MTFGQUY6ODNBOTgzOjZBNjI3QzQzIiwidmlzaXRvcl9pZCI6IjU0MDkwNjQwMDc0MzI4MzAwMTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac c247c6e815b864bc139f0dbe82b6d08bbc1a13c31099c92d77362d027b8187a0 hovercard-subject-tag issue:385960695 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/28748/issue_layout twitter:image https://opengraph.githubassets.com/ab86d3e91bdfab9e8976270127b0e511b1429e4200cfa04caf85a9e8e4d1d5e8/microsoft/TypeScript/issues/28748 twitter:card summary_large_image og:image https://opengraph.githubassets.com/ab86d3e91bdfab9e8976270127b0e511b1429e4200cfa04caf85a9e8e4d1d5e8/microsoft/TypeScript/issues/28748 og:image:alt TypeScript Version: 3.2.1 Search Terms: generic pick exclude Code // // Example 1 // const fn = og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username OliverJAsh hostname github.com expected-hostname github.com None 838e87bd0e4f5415707a930bc14e89e382dc2ea046e50ff575252eb2f2cb06a2 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 f0081192f88523d2bf4cfdf22bb3e138affc4cd1 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.