TypeScript/tests/cases/compiler/promiseTypeInference.ts

11 lines
350 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
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));