TypeScript/tests/cases/compiler/promiseTest.ts
2014-07-12 17:30:19 -07:00

15 lines
528 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


interface Promise<T> {
then<A>(success?: (value: T) => Promise<A>): Promise<A>;
then<B>(success?: (value: T) => B): Promise<B>;
data: T;
}
var p: Promise<number> = null;
var p2 = p.then(function (x) {
return p;
} );
var x = p2.data; // number