Repository: TypeScript
Issue: TypeScript unable to infer types properly between interfaces and overloaded methods.
Labels: Suggestion,Needs Proposal

# 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 overloads can be deprecated, then it breaks inference in some cases.

### 🔎 Search Terms

I'm not sure what to search for here. Interfaces? 

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- All versions

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[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)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
interface Observer<T> {
    next(value: T): void;
    error(error: any): void;
    complete(): void;
}

interface Unsubscribable {
    unsubscribe(): void;
}

interface Subscribable<T> {
    subscribe(observer?: Partial<Observer<T>>): Unsubscribable;
}

class Observable<T> implements Subscribable<T> {
    /////////////////////////////////////////
    // Valid call pattern
    /////////////////////////////////////////
    subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Unsubscribable;


    //////////////////////////////////////////
    // Deprecated call patterns
    //////////////////////////////////////////
    /**
     * @deprecated This call pattern is going away
     */
    subscribe(next: null | undefined, error: null | undefined, complete: () => void): Unsubscribable;
    /**
     * @deprecated This call pattern is going away
     */
    subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Unsubscribable;
    /**
     * @deprecated This call pattern is going away
     */
    subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Unsubscribable;
    /**
     * @deprecated This call pattern is going away
     */
    subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable;


    ////////////////////////////////////////////
    // Impl
    ////////////////////////////////////////////
    subscribe(...args: any[]): Unsubscribable {
        return {
            unsubscribe() {}
        };
    }
}


function somethingThatTakesSubscribable<T>(arg: Subscribable<T>): T {
    return null!;
}

/////////////////////////////////////
// Our failed expectation here
// (it's unknown)
/////////////////////////////////////
const result = somethingThatTakesSubscribable(new Observable<number>()); // $ExpectType number
```

### 🙁 Actual behavior

`result` is `unknown` above.

### 🙂 Expected behavior

`result` would be `number`.