tests/cases/compiler/promiseTypeInference.ts(10,34): error TS2345: Argument of type '(s: string) => IPromise<number>' is not assignable to parameter of type '(value: string) => number | PromiseLike<number>'.
  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.
        Type '<U>(success?: (value: number) => IPromise<U>) => IPromise<U>' is not assignable to type '<TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
          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 TS2345: Argument of type '(s: string) => IPromise<number>' is not assignable to parameter of type '(value: string) => number | PromiseLike<number>'.
!!! error TS2345:   Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
!!! error TS2345:     Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
!!! error TS2345:       Types of property 'then' are incompatible.
!!! error TS2345:         Type '<U>(success?: (value: number) => IPromise<U>) => IPromise<U>' is not assignable to type '<TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
!!! error TS2345:           Types of parameters 'success' and 'onfulfilled' are incompatible.
!!! error TS2345:             Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
!!! error TS2345:               Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
    