=== tests/cases/compiler/ipromise2.ts === declare module Windows.Foundation { >Windows : unknown >Foundation : unknown export interface IPromise { >IPromise : IPromise >T : T then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; >then : { (success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >U : U >success : (value: T) => IPromise >value : T >T : T >IPromise : IPromise >U : U >error : (error: any) => IPromise >error : any >IPromise : IPromise >U : U >progress : (progress: any) => void >progress : any >Windows : unknown >Foundation : unknown >IPromise : IPromise >U : U then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; >then : { (success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >U : U >success : (value: T) => IPromise >value : T >T : T >IPromise : IPromise >U : U >error : (error: any) => U >error : any >U : U >progress : (progress: any) => void >progress : any >Windows : unknown >Foundation : unknown >IPromise : IPromise >U : U then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; >then : { (success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >U : U >success : (value: T) => U >value : T >T : T >U : U >error : (error: any) => IPromise >error : any >IPromise : IPromise >U : U >progress : (progress: any) => void >progress : any >Windows : unknown >Foundation : unknown >IPromise : IPromise >U : U then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; >then : { (success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >U : U >success : (value: T) => U >value : T >T : T >U : U >error : (error: any) => U >error : any >U : U >progress : (progress: any) => void >progress : any >Windows : unknown >Foundation : unknown >IPromise : IPromise >U : U done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; >done : (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void) => void >U : U >success : (value: T) => any >value : T >T : T >error : (error: any) => any >error : any >progress : (progress: any) => void >progress : any value: T; >value : T >T : T } } var p: Windows.Foundation.IPromise; >p : Windows.Foundation.IPromise >Windows : unknown >Foundation : unknown >IPromise : Windows.Foundation.IPromise var p2 = p.then(function (s) { >p2 : Windows.Foundation.IPromise >p.then(function (s) { return 34;} ) : Windows.Foundation.IPromise >p.then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >p : Windows.Foundation.IPromise >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (s) { return 34;} : (s: string) => number >s : string return 34; } ); var x: number = p2.value; >x : number >p2.value : number >p2 : Windows.Foundation.IPromise >value : number