René's URL Explorer Experiment


Title: Call signatures of union types · Issue #7294 · microsoft/TypeScript · GitHub

Open Graph Title: Call signatures of union types · Issue #7294 · microsoft/TypeScript

X Title: Call signatures of union types · Issue #7294 · microsoft/TypeScript

Description: TypeScript Version: 1.8.4 Code type stringType1 = "foo" | "bar"; type stringType2 = "baz" | "bar"; interface Temp1 { getValue(name: stringType1); } interface Temp2 { getValue(name: stringType2); } function test(t: Temp1 | Temp2) { var z ...

Open Graph Description: TypeScript Version: 1.8.4 Code type stringType1 = "foo" | "bar"; type stringType2 = "baz" | "bar"; interface Temp1 { getValue(name: stringType1); } interface Temp2 { getValue(name: stringType2); } ...

X Description: TypeScript Version: 1.8.4 Code type stringType1 = "foo" | "bar"; type stringType2 = "baz" | "bar"; interface Temp1 { getValue(name: stringType1); } interface...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/7294

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Call signatures of union types","articleBody":"**TypeScript Version:** 1.8.4\n\n**Code**\n\n``` ts\ntype stringType1 = \"foo\" | \"bar\";\ntype stringType2 = \"baz\" | \"bar\";\n\ninterface Temp1 {\n    getValue(name: stringType1);\n}\n\ninterface Temp2 {\n    getValue(name: stringType2);\n}\n\nfunction test(t: Temp1 | Temp2) {\n    var  z = t.getValue(\"bar\"); // Error here\n}\n```\n\n**Expected behavior:**\nI was hoping everything would go fine (which is the case when I only use one interface in the function `test` \n\n**Actual behavior:** \nI get an error: \"Cannot invoke an expression whose type lacks a call signature\". Is this by design?\n","author":{"url":"https://github.com/DickvdBrink","@type":"Person","name":"DickvdBrink"},"datePublished":"2016-02-29T11:18:15Z","url":"https://github.com/microsoft/TypeScript/issues/7294"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:418bb89e-16b9-8c0c-2db4-031cf4cf3975
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF0A:DB09F:589551:72A0F0:6B00DD06
html-safe-nonce0a8a14b7b31dab6dee0b1ab039b8d24d1812b839bf6ec097fbcf4340dac854f9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjBBOkRCMDlGOjU4OTU1MTo3MkEwRjA6NkIwMEREMDYiLCJ2aXNpdG9yX2lkIjoiODIxNTcwNDg5Nzc2OTc1Nzk1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacad54cb4c6f9826b9ae00bcbb0593606f3ee56a7f8755bd52d50e66aa71e6279c
hovercard-subject-tagissue:137224501
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/7294/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8eac20d50dd1d9fc9bbe6366eecd1e47a464702ce7bf0cf712b3242f3c80e722/microsoft/TypeScript/issues/7294
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8eac20d50dd1d9fc9bbe6366eecd1e47a464702ce7bf0cf712b3242f3c80e722/microsoft/TypeScript/issues/7294
og:image:altTypeScript Version: 1.8.4 Code type stringType1 = "foo" | "bar"; type stringType2 = "baz" | "bar"; interface Temp1 { getValue(name: stringType1); } interface Temp2 { getValue(name: stringType2); } ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDickvdBrink
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/7294#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F7294
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F7294
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/7294
Reloadhttps://github.com/microsoft/TypeScript/issues/7294
Reloadhttps://github.com/microsoft/TypeScript/issues/7294
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7294
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7294
#29011https://github.com/microsoft/TypeScript/pull/29011
Call signatures of union typeshttps://github.com/microsoft/TypeScript/issues/7294#top
#29011https://github.com/microsoft/TypeScript/pull/29011
RevisitAn issue worth coming back tohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Revisit%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/DickvdBrink
Dick van den Brink (DickvdBrink)https://github.com/DickvdBrink
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7294#issue-137224501
Nexthttps://github.com/microsoft/TypeScript/issues/7294?timeline_page=1
https://github.com/Igorbek
Igor Oleinikov (Igorbek)https://github.com/Igorbek
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7294#issuecomment-190295492
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7294#event-571625758
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7294#issuecomment-190335544
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7294#event-571632366
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Mar 1, 2016https://github.com/microsoft/TypeScript/issues/7294#issuecomment-190749822
Dick van den Brink (@DickvdBrink)https://github.com/DickvdBrink
https://github.com/DickvdBrink
Dick van den Brink (DickvdBrink)https://github.com/DickvdBrink
on Mar 1, 2016https://github.com/microsoft/TypeScript/issues/7294#issuecomment-190848416
Aleksey-Bykovhttps://github.com/Aleksey-Bykov
https://github.com/masaeedu
Asad Saeeduddin (masaeedu)https://github.com/masaeedu
on Apr 21, 2017https://github.com/microsoft/TypeScript/issues/7294#issuecomment-296292968
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
these ruleshttps://github.com/Microsoft/TypeScript/issues/14107#issuecomment-296265761
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on Apr 24, 2017https://github.com/microsoft/TypeScript/issues/7294#event-1055321590
https://github.com/vinz243
vinz243 (vinz243)https://github.com/vinz243
on May 2, 2017https://github.com/microsoft/TypeScript/issues/7294#issuecomment-298465414
https://github.com/alienriver49
Brian Jackson (alienriver49)https://github.com/alienriver49
on Jun 21, 2017https://github.com/microsoft/TypeScript/issues/7294#issuecomment-310200367
https://github.com/Igorbek
Igor Oleinikov (Igorbek)https://github.com/Igorbek
on Jun 21, 2017https://github.com/microsoft/TypeScript/issues/7294#issuecomment-310204498
https://github.com/mboudreau
Michel Boudreau (mboudreau)https://github.com/mboudreau
on Jul 20, 2017https://github.com/microsoft/TypeScript/issues/7294#issuecomment-316575284
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
RevisitAn issue worth coming back tohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Revisit%22
on Oct 10, 2017https://github.com/microsoft/TypeScript/issues/7294#event-1286638997
Bruno Lemos (brunolemos)https://github.com/brunolemos
on Nov 3, 2018https://github.com/microsoft/TypeScript/issues/7294#event-1944492494
[Redux] Fix action creator type definitionhttps://github.com/devhubapp/devhub/commit/63da11a11890adbdcda44dbeb0bd4461680d4598
63da11ahttps://github.com/devhubapp/devhub/commit/63da11a11890adbdcda44dbeb0bd4461680d4598
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#29011https://github.com/microsoft/TypeScript/pull/29011
on Dec 20, 2018https://github.com/microsoft/TypeScript/issues/7294#event-2037157057
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on Feb 7, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-461459092
questionshttps://stackoverflow.com/questions/54575849/typescript-control-flow-analysis-doesnt-recognise-a-known-type
#14466https://github.com/microsoft/TypeScript/issues/14466
#25051https://github.com/microsoft/TypeScript/issues/25051
#29011https://github.com/microsoft/TypeScript/pull/29011
#25051https://github.com/microsoft/TypeScript/issues/25051
https://github.com/Kinrany
Ruslan Fadeev (Kinrany)https://github.com/Kinrany
on Feb 7, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-461499427
Joe Calzaretta (@jcalz)https://github.com/jcalz
generic valueshttps://github.com/Microsoft/TypeScript/issues/17574
https://github.com/dragomirtitian
Titian Cernicova-Dragomir (dragomirtitian)https://github.com/dragomirtitian
on Feb 7, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-461508208
Ruslan Fadeev (@Kinrany)https://github.com/Kinrany
Joe Calzaretta (@jcalz)https://github.com/jcalz
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on Feb 8, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-461833862
Ruslan Fadeev (@Kinrany)https://github.com/Kinrany
#17713https://github.com/microsoft/TypeScript/issues/17713
#25051https://github.com/microsoft/TypeScript/issues/25051
https://github.com/WreckedAvent
Riley Cat (WreckedAvent)https://github.com/WreckedAvent
on Feb 20, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-465794460
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Feb 20, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-465801362
https://github.com/bayareacoder
B (bayareacoder)https://github.com/bayareacoder
on May 2, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-488519208
https://github.com/sinisterstumble
sinisterstumblehttps://github.com/sinisterstumble
on May 3, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-489084753
https://github.com/jacekkarczmarczyk
Jacek Karczmarczyk (jacekkarczmarczyk)https://github.com/jacekkarczmarczyk
on May 28, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-496370399
https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20
https://github.com/ackvf
Qwerty (Vítězslav Ackermann Ferko) (ackvf)https://github.com/ackvf
on Sep 30, 2019https://github.com/microsoft/TypeScript/issues/7294#issuecomment-536498667
issue@33591https://github.com/microsoft/TypeScript/issues/33591
https://github.com/snebjorn
Eskild Diderichsen (snebjorn)https://github.com/snebjorn
on Jan 6, 2020https://github.com/microsoft/TypeScript/issues/7294#issuecomment-571135767
https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20
https://github.com/abrasher
Amber (abrasher)https://github.com/abrasher
on May 26, 2021https://github.com/microsoft/TypeScript/issues/7294#issuecomment-849164594
https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20https://www.typescriptlang.org/play/#src=interface%20Fizz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20fizz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Buzz%20%7B%0D%0A%20%20%20%20id%3A%20number%3B%0D%0A%20%20%20%20buzz%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A(%5B%5D%20as%20Fizz%5B%5D%20%7C%20Buzz%5B%5D).map(item%20%3D%3E%20item.id)%3B%20
FIxed in TypeScript 4.3!https://devblogs.microsoft.com/typescript/announcing-typescript-4-3/#contextual-narrowing
https://github.com/tiagojdf
Tiago Ferreira (tiagojdf)https://github.com/tiagojdf
on Jun 1, 2021https://github.com/microsoft/TypeScript/issues/7294#issuecomment-852282269
#20190https://github.com/microsoft/TypeScript/issues/20190
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/7294
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7294
RevisitAn issue worth coming back tohttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Revisit%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.