Title: Intersected function type returns only first constituent's return type · Issue #10508 · microsoft/TypeScript · GitHub
Open Graph Title: Intersected function type returns only first constituent's return type · Issue #10508 · microsoft/TypeScript
X Title: Intersected function type returns only first constituent's return type · Issue #10508 · microsoft/TypeScript
Description: TypeScript Version: 1.8/Playground Code interface A { a: boolean; } interface B { b: boolean; } declare const fooAB: (() => A) & (() => B); const ab = fooAB(); // A Expected behavior: ab has type A & B Actual behavior: ab has type A Perh...
Open Graph Description: TypeScript Version: 1.8/Playground Code interface A { a: boolean; } interface B { b: boolean; } declare const fooAB: (() => A) & (() => B); const ab = fooAB(); // A Expected behavior: ab has type A...
X Description: TypeScript Version: 1.8/Playground Code interface A { a: boolean; } interface B { b: boolean; } declare const fooAB: (() => A) & (() => B); const ab = fooAB(); // A Expected behavior: ab ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/10508
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Intersected function type returns only first constituent's return type","articleBody":"\u003c!-- BUGS: Please use this template. -->\n\n**TypeScript Version:** 1.8/Playground\n\n**Code**\n\n``` ts\ninterface A {\n a: boolean;\n}\ninterface B {\n b: boolean;\n}\n\ndeclare const fooAB: (() => A) & (() => B);\nconst ab = fooAB(); // A\n```\n\n**Expected behavior:** `ab` has type `A & B`\n\n**Actual behavior:** `ab` has type `A`\n\nPerhaps this is being treated as an overloaded call signature, and `() => A` just happens to be first. If this is by design, it would be great to learn about any known workarounds.\n\ncc @kevinder\n","author":{"url":"https://github.com/vsiao","@type":"Person","name":"vsiao"},"datePublished":"2016-08-23T20:00:56Z","url":"https://github.com/microsoft/TypeScript/issues/10508"}
| 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:77f29b90-7917-5fdf-6bd6-8703967d6aec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B398:A99C2:94A431:C13012:6B00DE18 |
| html-safe-nonce | a9f406d10e61fb6003a59d62a86de7da53292c11ac9943612bd8a8a49ce8e798 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzk4OkE5OUMyOjk0QTQzMTpDMTMwMTI6NkIwMERFMTgiLCJ2aXNpdG9yX2lkIjoiNjA4MTQ0MzQ2NTUwNDI4NDE4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed57903ac58a867d00aa07a9abc5c51e633aea596223a0f4f17cc3c76171ba59 |
| hovercard-subject-tag | issue:172792358 |
| 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/10508/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d426179103373bd382d33706a82377e939e5a52f185af18abe205477fe3ec96/microsoft/TypeScript/issues/10508 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d426179103373bd382d33706a82377e939e5a52f185af18abe205477fe3ec96/microsoft/TypeScript/issues/10508 |
| og:image:alt | TypeScript Version: 1.8/Playground Code interface A { a: boolean; } interface B { b: boolean; } declare const fooAB: (() => A) & (() => B); const ab = fooAB(); // A Expected behavior: ab has type A... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vsiao |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width