2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/bestCommonTypeReturnStatement.ts ===
|
|
|
|
interface IPromise<T> {
|
|
|
|
>IPromise : IPromise<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
|
|
|
>then : (successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any) => IPromise<any>
|
|
|
|
>successCallback : (promiseValue: T) => any
|
|
|
|
>promiseValue : T
|
|
|
|
>T : T
|
|
|
|
>errorCallback : (reason: any) => any
|
|
|
|
>reason : any
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
>f : () => IPromise<void>
|
|
|
|
|
|
|
|
if (true) return b();
|
|
|
|
>b() : IPromise<void>
|
|
|
|
>b : () => IPromise<void>
|
|
|
|
|
|
|
|
return d();
|
|
|
|
>d() : IPromise<any>
|
|
|
|
>d : () => IPromise<any>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function b(): IPromise<void> { return null; }
|
|
|
|
>b : () => IPromise<void>
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function d(): IPromise<any> { return null; }
|
|
|
|
>d : () => IPromise<any>
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|