50 lines
2.5 KiB
Text
50 lines
2.5 KiB
Text
=== tests/cases/compiler/promiseTypeInference.ts ===
|
|
declare class Promise<T> {
|
|
>Promise : Symbol(Promise, Decl(promiseTypeInference.ts, 0, 0))
|
|
>T : Symbol(T, Decl(promiseTypeInference.ts, 0, 22))
|
|
|
|
then<U>(success?: (value: T) => Promise<U>): Promise<U>;
|
|
>then : Symbol(then, Decl(promiseTypeInference.ts, 0, 26))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9))
|
|
>success : Symbol(success, Decl(promiseTypeInference.ts, 1, 12))
|
|
>value : Symbol(value, Decl(promiseTypeInference.ts, 1, 23))
|
|
>T : Symbol(T, Decl(promiseTypeInference.ts, 0, 22))
|
|
>Promise : Symbol(Promise, Decl(promiseTypeInference.ts, 0, 0))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9))
|
|
>Promise : Symbol(Promise, Decl(promiseTypeInference.ts, 0, 0))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 1, 9))
|
|
}
|
|
interface IPromise<T> {
|
|
>IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1))
|
|
>T : Symbol(T, Decl(promiseTypeInference.ts, 3, 19))
|
|
|
|
then<U>(success?: (value: T) => IPromise<U>): IPromise<U>;
|
|
>then : Symbol(then, Decl(promiseTypeInference.ts, 3, 23))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 4, 9))
|
|
>success : Symbol(success, Decl(promiseTypeInference.ts, 4, 12))
|
|
>value : Symbol(value, Decl(promiseTypeInference.ts, 4, 23))
|
|
>T : Symbol(T, Decl(promiseTypeInference.ts, 3, 19))
|
|
>IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 4, 9))
|
|
>IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1))
|
|
>U : Symbol(U, Decl(promiseTypeInference.ts, 4, 9))
|
|
}
|
|
declare function load(name: string): Promise<string>;
|
|
>load : Symbol(load, Decl(promiseTypeInference.ts, 5, 1))
|
|
>name : Symbol(name, Decl(promiseTypeInference.ts, 6, 22))
|
|
>Promise : Symbol(Promise, Decl(promiseTypeInference.ts, 0, 0))
|
|
|
|
declare function convert(s: string): IPromise<number>;
|
|
>convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 53))
|
|
>s : Symbol(s, Decl(promiseTypeInference.ts, 7, 25))
|
|
>IPromise : Symbol(IPromise, Decl(promiseTypeInference.ts, 2, 1))
|
|
|
|
var $$x = load("something").then(s => convert(s));
|
|
>$$x : Symbol($$x, Decl(promiseTypeInference.ts, 9, 3))
|
|
>load("something").then : Symbol(Promise.then, Decl(promiseTypeInference.ts, 0, 26))
|
|
>load : Symbol(load, Decl(promiseTypeInference.ts, 5, 1))
|
|
>then : Symbol(Promise.then, Decl(promiseTypeInference.ts, 0, 26))
|
|
>s : Symbol(s, Decl(promiseTypeInference.ts, 9, 33))
|
|
>convert : Symbol(convert, Decl(promiseTypeInference.ts, 6, 53))
|
|
>s : Symbol(s, Decl(promiseTypeInference.ts, 9, 33))
|
|
|