René's URL Explorer Experiment


Title: TypeScript unable to infer types properly between interfaces and overloaded methods. · Issue #43643 · microsoft/TypeScript · GitHub

Open Graph Title: TypeScript unable to infer types properly between interfaces and overloaded methods. · Issue #43643 · microsoft/TypeScript

X Title: TypeScript unable to infer types properly between interfaces and overloaded methods. · Issue #43643 · microsoft/TypeScript

Description: Bug Report In all versions of TS I can find, there's no way to mark certain call patterns of a method as deprecated while maintaining inference with certain interfaces. If an interface is split out into different overloads so certain ove...

Open Graph Description: Bug Report In all versions of TS I can find, there's no way to mark certain call patterns of a method as deprecated while maintaining inference with certain interfaces. If an interface is split out...

X Description: Bug Report In all versions of TS I can find, there's no way to mark certain call patterns of a method as deprecated while maintaining inference with certain interfaces. If an interface is split...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript unable to infer types properly between interfaces and overloaded methods.","articleBody":"# Bug Report\r\n\r\nIn all versions of TS I can find, there's no way to mark certain call patterns of a method as deprecated while maintaining inference with certain interfaces. If an interface is split out into different overloads so certain overloads can be deprecated, then it breaks inference in some cases.\r\n\r\n### 🔎 Search Terms\r\n\r\nI'm not sure what to search for here. Interfaces? \r\n\r\n### 🕗 Version & Regression Information\r\n\r\n\u003c!-- When did you start seeing this bug occur?\r\n\r\n\"Bugs\" that have existed in TS for a long time are very likely to be FAQs; refer to\r\n  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs\r\n\r\nIf possible, please try testing the nightly version of TS to see if it's 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\nNote: The TypeScript Playground can be used to try older versions of TypeScript.\r\n\r\nPlease keep and fill in the line that best applies:\r\n-->\r\n- All versions\r\n\r\n### ⏯ Playground Link\r\n\r\n\u003c!--\r\n  A link to a TypeScript Playground \"Share\" link which shows this behavior\r\n\r\n  The TypeScript Workbench can be used for more complex setups, try\r\n  https://www.typescriptlang.org/dev/bug-workbench/\r\n\r\n  As a last resort, you can link to a repo, but these will be slower for us to investigate.\r\n-->\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgPICMDO0Bu0A8AKgHzIDeAsAFDK3IgQAeYAFDnADYCuEAXMoQCU-HAHtgAEwDc1OsmhRRUFgqX84IAJ7DkYyTJp0EogLYAHDhEgsde6dQC+1aqEixEKAKohMXLAihgdDh0S3JZOi4fP0wAoIgbEXF7KicqF3BoeCRkAGUYuODQiCJSSkNaX39A9ATRLFxoAH5+AAU4KDBgTnwMbCg8KFLiHW8q2JqQywM06gQOOExMNAaBqZKSZGBzSxMIcGX86qD10vCK5AB6a5vbu-uHx7uI2mvkADVOSWQETg5kMxwMBuEAvK5PCGQiFg8aFOqrQaoKAAOSYYBayHanW6HF6CIIJFIAB9kCw2JwePwhMgALykOyCUbRY5FabOdIXKFc7k3MFvAAiEDMUAgv0gEh+fwBQJBmD5PIV0M5ACplWDkMrkAABCRCkViiASwgAC2Ay1+HH+gOB0BAW2WAHNxCAHcg4AB3OCadXKy4wgo1BIMZj8EBcS3IElRXUwUCGgA08igiigofD-yjIBjcYkieMOysfFJglp9OSTNhk2KBjkl1VPu1uuFoqBhoEpvNUutIPtyCdoFdHq9Pr9F0r8RYwbAaYjmezDFzSZT-BUybUbq0JbpumSedMFkLGJspZ3kgrAZO1b59YuGsbepb4vbZslEe7tt7-Zdbs93tvvv9FkgzRFd2G4ItqW3OxE1UVN6HTSNkGjCBYwXPcC0gFctzLM9+DGC9WQgGs6DrNV-3vZsDSNDtXytGUPxfL9B1-EdAImCcpyPMDKQEbDT0XWCj1g9RNxPaCfn3SxICPPiGTw5l2MIgx2VrRU1MeeVkAASR2eV1P03kxwIhIADozI6B1MBEzQAG0AF1zxZdZzjkOQRTALgoDtcpXN8pCFLhY8yDSPzkAcYjaDSWYORgKIEC6UQ7UwUwrFNF0TSBQg4AAawgTAjkU04SBYCz+AKwoipGKkXLodzPLtMNLQAQhmdkDIVag3lQTzkHgYBLAlJgzFFMAgWARLkGNaAIE6y5SWAMAAHJliibKQFEd0QEEWb2q5OZEswMBkBFXwOCOmlkGSvYwDSh0MrALLcvygj1knCB3RWfp2GKfAwxMWooGIGxBCkcFkAAEgAUUYYb4sITRhvg-7oCAA)\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well-->\r\n```ts\r\ninterface Observer\u003cT> {\r\n    next(value: T): void;\r\n    error(error: any): void;\r\n    complete(): void;\r\n}\r\n\r\ninterface Unsubscribable {\r\n    unsubscribe(): void;\r\n}\r\n\r\ninterface Subscribable\u003cT> {\r\n    subscribe(observer?: Partial\u003cObserver\u003cT>>): Unsubscribable;\r\n}\r\n\r\nclass Observable\u003cT> implements Subscribable\u003cT> {\r\n    /////////////////////////////////////////\r\n    // Valid call pattern\r\n    /////////////////////////////////////////\r\n    subscribe(observerOrNext?: Partial\u003cObserver\u003cT>> | ((value: T) => void)): Unsubscribable;\r\n\r\n\r\n    //////////////////////////////////////////\r\n    // Deprecated call patterns\r\n    //////////////////////////////////////////\r\n    /**\r\n     * @deprecated This call pattern is going away\r\n     */\r\n    subscribe(next: null | undefined, error: null | undefined, complete: () => void): Unsubscribable;\r\n    /**\r\n     * @deprecated This call pattern is going away\r\n     */\r\n    subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Unsubscribable;\r\n    /**\r\n     * @deprecated This call pattern is going away\r\n     */\r\n    subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Unsubscribable;\r\n    /**\r\n     * @deprecated This call pattern is going away\r\n     */\r\n    subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable;\r\n\r\n\r\n    ////////////////////////////////////////////\r\n    // Impl\r\n    ////////////////////////////////////////////\r\n    subscribe(...args: any[]): Unsubscribable {\r\n        return {\r\n            unsubscribe() {}\r\n        };\r\n    }\r\n}\r\n\r\n\r\nfunction somethingThatTakesSubscribable\u003cT>(arg: Subscribable\u003cT>): T {\r\n    return null!;\r\n}\r\n\r\n/////////////////////////////////////\r\n// Our failed expectation here\r\n// (it's unknown)\r\n/////////////////////////////////////\r\nconst result = somethingThatTakesSubscribable(new Observable\u003cnumber>()); // $ExpectType number\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n`result` is `unknown` above.\r\n\r\n### 🙂 Expected behavior\r\n\r\n`result` would be `number`.\r\n","author":{"url":"https://github.com/benlesh","@type":"Person","name":"benlesh"},"datePublished":"2021-04-12T15:25:15Z","url":"https://github.com/microsoft/TypeScript/issues/43643"}

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:83489fca-49a3-4979-8f98-36bd477c0bc0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC710:4BB79:17D91B2:1E6B211:6B0143B3
html-safe-noncee33a0d1b60c60fe0c4f6deb81aa291bf7da3a4366d5accbffc6f8c2a108bc994
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzEwOjRCQjc5OjE3RDkxQjI6MUU2QjIxMTo2QjAxNDNCMyIsInZpc2l0b3JfaWQiOiIxMjA0NDU1OTY4NTgzMjcxMzQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac388b2a571f93a9bc5e93f853419d356fb96bf8e04b2e7f19a0926b907ad9a3f5
hovercard-subject-tagissue:856090249
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/43643/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7ac113641218086c8f5d6e08e290b007727f0ead3cb231a84afdd462cf1c6046/microsoft/TypeScript/issues/43643
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7ac113641218086c8f5d6e08e290b007727f0ead3cb231a84afdd462cf1c6046/microsoft/TypeScript/issues/43643
og:image:altBug Report In all versions of TS I can find, there's no way to mark certain call patterns of a method as deprecated while maintaining inference with certain interfaces. If an interface is split out...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebenlesh
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/43643#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F43643
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%2F43643
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/43643
Reloadhttps://github.com/microsoft/TypeScript/issues/43643
Reloadhttps://github.com/microsoft/TypeScript/issues/43643
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests311 (311)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/43643
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43643
TypeScript unable to infer types properly between interfaces and overloaded methods.https://github.com/microsoft/TypeScript/issues/43643#top
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
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/benlesh
Ben Lesh (benlesh)https://github.com/benlesh
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43643#issue-856090249
Playground link with relevant codehttps://www.typescriptlang.org/play#code/JYOwLgpgTgZghgYwgAgPICMDO0Bu0A8AKgHzIDeAsAFDK3Ig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UUYYb4sITRhvg-7oCAA
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
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
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43643#event-4583761738
https://github.com/benlesh
Ben Lesh (benlesh)https://github.com/benlesh
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43643#issuecomment-818048923
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43643#issuecomment-818066884
Ben Lesh (benlesh)https://github.com/benlesh
on Apr 13, 2021https://github.com/microsoft/TypeScript/issues/43643#event-4589461088
fix(core): AsyncPipe now compatible with RxJS 7https://github.com/benlesh/angular/commit/679fb71b49ad5efb1b09480a650fcf8eeb64a0c8
679fb71https://github.com/benlesh/angular/commit/679fb71b49ad5efb1b09480a650fcf8eeb64a0c8
Miško Hevery (mhevery)https://github.com/mhevery
on May 4, 2021https://github.com/microsoft/TypeScript/issues/43643#event-4684122582
fix(core): AsyncPipe now compatible with RxJS 7 (#41590)https://github.com/angular/angular/commit/e387d22f832bc0e15b8f4a575daec454765244f8
#41590https://github.com/angular/angular/pull/41590
e387d22https://github.com/angular/angular/commit/e387d22f832bc0e15b8f4a575daec454765244f8
fix(core): AsyncPipe now compatible with RxJS 7 (#41590)https://github.com/angular/angular/commit/9759bca339b44ed78ec6aafab0336d531d285f90
#41590https://github.com/angular/angular/pull/41590
9759bcahttps://github.com/angular/angular/commit/9759bca339b44ed78ec6aafab0336d531d285f90
fix(core): AsyncPipe now compatible with RxJS 7 (#41590)https://github.com/angular/angular/commit/7a86ebfcf6d0a2beb66ae628e58ef0741d624e11
#41590https://github.com/angular/angular/pull/41590
7a86ebfhttps://github.com/angular/angular/commit/7a86ebfcf6d0a2beb66ae628e58ef0741d624e11
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/43643
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43643
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
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.