Title: Keyof function args suggest all keys · Issue #36025 · microsoft/TypeScript · GitHub
Open Graph Title: Keyof function args suggest all keys · Issue #36025 · microsoft/TypeScript
X Title: Keyof function args suggest all keys · Issue #36025 · microsoft/TypeScript
Description: TypeScript Version: 3.7.2 Search Terms: keyof interface function arguments args Code export interface ISocialButtonTypes { vk: {vk: string}; fb: {fb: string}; ok: {ok: string}; twitter: {tw: string}; }; export type createSocialItem = Open Graph Description: TypeScript Version: 3.7.2 Search Terms: keyof interface function arguments args Code export interface ISocialButtonTypes { vk: {vk: string}; fb: {fb: string}; ok: {ok: string}; twitter: {tw: string...
X Description: TypeScript Version: 3.7.2 Search Terms: keyof interface function arguments args Code export interface ISocialButtonTypes { vk: {vk: string}; fb: {fb: string}; ok: {ok: string}; twitter: {tw: string...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/36025
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Keyof function args suggest all keys","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-->\r\n\r\n\u003c!--\r\nPlease try to reproduce the issue with the latest published version. It may have already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n-->\r\n**TypeScript Version:** 3.7.2\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\nkeyof interface function arguments args\r\n\r\n**Code**\r\n\r\n```ts\r\n\r\nexport interface ISocialButtonTypes {\r\n vk: {vk: string};\r\n fb: {fb: string};\r\n ok: {ok: string};\r\n twitter: {tw: string};\r\n};\r\n\r\nexport type createSocialItem = \u003cT extends keyof ISocialButtonTypes>(\r\n socialType: T,\r\n params: ISocialButtonTypes[T]\r\n) => void;\r\n\r\nfunction createSocialItem\u003cT extends keyof ISocialButtonTypes>(\r\n socialType: T,\r\n params?: ISocialButtonTypes[T]\r\n): ISocialButtonTypes[T] {\r\n return params\r\n}\r\n// the compiler show error, but suggest all keys\r\ncreateSocialItem('vk', { ok: 'dwdw' })\r\n ~~~~~~~~~~~~~\r\n```\r\n\r\n**Expected behavior:**\r\nThe second param should suggest only `vk` key.\r\n\r\n**Actual behavior:**\r\nThe params field suggests all keys, but the compiler show error on the incorrect key. The function return works correctly\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\nhttps://cutt.ly/cruK8eX\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\n","author":{"url":"https://github.com/ar53n","@type":"Person","name":"ar53n"},"datePublished":"2020-01-06T13:07:54Z","url":"https://github.com/microsoft/TypeScript/issues/36025"}
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:178edd96-054d-2358-601f-ce2c6390dd9e current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id DB28:1F65:4AA8BB:5E51BB:6B012993 html-safe-nonce d2f5d5968d8c57e18ffe385f685a1a2632ae4c266ff671ace782b74ae03e2c32 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjI4OjFGNjU6NEFBOEJCOjVFNTFCQjo2QjAxMjk5MyIsInZpc2l0b3JfaWQiOiI3MjkyNzM1NzIzMTQ3NDM4NDgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac fb596bfb09bad53c31945486315b99fcb52d754649f224dbabc0100d793ba8cc hovercard-subject-tag issue:545717233 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/36025/issue_layout twitter:image https://opengraph.githubassets.com/179ff389b46fbbbba5debde9a59d42d4f590e6eca5672fe3a50acadf80696c53/microsoft/TypeScript/issues/36025 twitter:card summary_large_image og:image https://opengraph.githubassets.com/179ff389b46fbbbba5debde9a59d42d4f590e6eca5672fe3a50acadf80696c53/microsoft/TypeScript/issues/36025 og:image:alt TypeScript Version: 3.7.2 Search Terms: keyof interface function arguments args Code export interface ISocialButtonTypes { vk: {vk: string}; fb: {fb: string}; ok: {ok: string}; twitter: {tw: string... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username ar53n 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.