tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2769: No overload matches this call.
  Overload 1 of 2, '(success?: (value: string) => Promise<unknown>): Promise<unknown>', gave the following error.
    Property 'catch' is missing in type 'IPromise<number>' but required in type 'Promise<unknown>'.
  Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike<number>, onrejected?: (reason: any) => PromiseLike<never>): Promise<number>', gave the following error.
    Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
      Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
        Types of property 'then' are incompatible.
          Types of parameters 'success' and 'onfulfilled' are incompatible.
            Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
              Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.


==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ====
    declare class Promise<T> {
        then<U>(success?: (value: T) => Promise<U>): Promise<U>;
    }
    interface IPromise<T> {
        then<U>(success?: (value: T) => IPromise<U>): IPromise<U>;
    }
    declare function load(name: string): Promise<string>;
    declare function convert(s: string): IPromise<number>;
    
    var $$x = load("something").then(s => convert(s));
                                          ~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 2, '(success?: (value: string) => Promise<unknown>): Promise<unknown>', gave the following error.
!!! error TS2769:     Property 'catch' is missing in type 'IPromise<number>' but required in type 'Promise<unknown>'.
!!! error TS2769:   Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike<number>, onrejected?: (reason: any) => PromiseLike<never>): Promise<number>', gave the following error.
!!! error TS2769:     Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
!!! error TS2769:       Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
!!! error TS2769:         Types of property 'then' are incompatible.
!!! error TS2769:           Types of parameters 'success' and 'onfulfilled' are incompatible.
!!! error TS2769:             Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
!!! error TS2769:               Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
!!! related TS2728 /.ts/lib.es5.d.ts:1430:5: 'catch' is declared here.
!!! related TS6502 tests/cases/compiler/promiseTypeInference.ts:2:23: The expected type comes from the return type of this signature.
!!! related TS6502 /.ts/lib.es5.d.ts:1423:57: The expected type comes from the return type of this signature.
    