Title: Bug: incorrect contextual typing on yield expression of generator function as discriminate of a union · Issue #51187 · microsoft/TypeScript · GitHub
Open Graph Title: Bug: incorrect contextual typing on yield expression of generator function as discriminate of a union · Issue #51187 · microsoft/TypeScript
X Title: Bug: incorrect contextual typing on yield expression of generator function as discriminate of a union · Issue #51187 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms generator function union contextual typing yield expression 🕗 Version & Regression Information 4.8.4 ⏯ Playground Link Playground link with relevant code 💻 Code type Action = () => (Generator Open Graph Description: Bug Report 🔎 Search Terms generator function union contextual typing yield expression 🕗 Version & Regression Information 4.8.4 ⏯ Playground Link Playground link with relevant code 💻 Code type Actio...
X Description: Bug Report 🔎 Search Terms generator function union contextual typing yield expression 🕗 Version & Regression Information 4.8.4 ⏯ Playground Link Playground link with relevant code 💻 Code type A...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/51187
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: incorrect contextual typing on yield expression of generator function as discriminate of a union","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\ngenerator function union contextual typing yield expression\r\n\r\n### 🕗 Version \u0026 Regression Information\r\n\r\n\r\n4.8.4\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/C4TwDgpgBAggxsAlgewHZQLxQBQEpMB8OA4hKhAE4CGwyFAPAM7AWKoDmANFM6x97zbsA2gF0iAHx4shuAFBy4aZlABGALlgIU6LADMArqm1oAVDnwBvBTah2oS1CriYoIRBAA2AEygByPzl7KAoIYAMKdAC5AF85IA)\r\n\r\n\r\n\r\n### 💻 Code\r\n\r\n\r\n```ts\r\ntype Action = () =\u003e (Generator\u003cstring, string, string[]\u003e | string)\r\n\r\nconst b: Action = function* () {\r\n // expect `string[]`, actual `never`\r\n const c = yield ''\r\n return ''\r\n}\r\n\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n`never`\r\n\r\n### 🙂 Expected behavior\r\n\r\n`string[]`\r\n","author":{"url":"https://github.com/shigma","@type":"Person","name":"shigma"},"datePublished":"2022-10-15T16:07:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/51187/TypeScript/issues/51187"}
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:a1b32c8a-0184-b807-eb16-48f7c42fb0f0 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id DDAA:A0FFF:7ED45:BA038:6A621238 html-safe-nonce e3b89a47c44ba626854de8938de28a2e811a58865711a1568727d5ef0117802b visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEREFBOkEwRkZGOjdFRDQ1OkJBMDM4OjZBNjIxMjM4IiwidmlzaXRvcl9pZCI6Ijg5NjYwMjk1NDI1NjczMTgwNzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 9cc496387ca4108a03b3fae7c7061191ee3afea9d8b449c3fe656d35f42def9a hovercard-subject-tag issue:1410213643 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/51187/issue_layout twitter:image https://opengraph.githubassets.com/18b023c7a62edf2ed02eba03695b1cedb765a2addec3c8b458d65b9951143207/microsoft/TypeScript/issues/51187 twitter:card summary_large_image og:image https://opengraph.githubassets.com/18b023c7a62edf2ed02eba03695b1cedb765a2addec3c8b458d65b9951143207/microsoft/TypeScript/issues/51187 og:image:alt Bug Report 🔎 Search Terms generator function union contextual typing yield expression 🕗 Version & Regression Information 4.8.4 ⏯ Playground Link Playground link with relevant code 💻 Code type Actio... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username shigma hostname github.com expected-hostname github.com None be9a4d9589756e22b427637ffbf1123a96e067050e57f5cec403e3080a650ca4 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 7b5509702f01f876c214a2cbb142690847de0019 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.