90 lines
4.1 KiB
Plaintext
90 lines
4.1 KiB
Plaintext
=== tests/cases/compiler/promiseIdentity.ts ===
|
|
export interface IPromise<T> {
|
|
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26))
|
|
|
|
then<U>(callback: (x: T) => IPromise<U>): IPromise<U>;
|
|
>then : Symbol(IPromise.then, Decl(promiseIdentity.ts, 0, 30))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
|
|
>callback : Symbol(callback, Decl(promiseIdentity.ts, 1, 12))
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 1, 23))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26))
|
|
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
|
|
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
|
|
}
|
|
interface Promise<T> {
|
|
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 3, 18))
|
|
|
|
then<U>(callback: (x: T) => Promise<U>): Promise<U>;
|
|
>then : Symbol(Promise.then, Decl(promiseIdentity.ts, 3, 22))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
|
|
>callback : Symbol(callback, Decl(promiseIdentity.ts, 4, 12))
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 4, 23))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 3, 18))
|
|
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
|
|
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
|
|
}
|
|
var x: IPromise<string>;
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3))
|
|
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
|
|
|
|
var x: Promise<string>;
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3))
|
|
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
|
|
|
|
|
|
interface IPromise2<T, V> {
|
|
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 10, 20))
|
|
>V : Symbol(V, Decl(promiseIdentity.ts, 10, 22))
|
|
|
|
then<U, W>(callback: (x: T) => IPromise2<U, W>): IPromise2<W, U>;
|
|
>then : Symbol(IPromise2.then, Decl(promiseIdentity.ts, 10, 27))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
|
|
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
|
|
>callback : Symbol(callback, Decl(promiseIdentity.ts, 11, 15))
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 11, 26))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 10, 20))
|
|
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
|
|
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
|
|
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
|
|
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
|
|
}
|
|
interface Promise2<T, V> {
|
|
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
|
|
>V : Symbol(V, Decl(promiseIdentity.ts, 13, 21))
|
|
|
|
then<U, W>(callback: (x: V) => Promise2<U, T>): Promise2<T, W>; // Uses V instead of T in callback's parameter
|
|
>then : Symbol(Promise2.then, Decl(promiseIdentity.ts, 13, 26))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 14, 9))
|
|
>W : Symbol(W, Decl(promiseIdentity.ts, 14, 11))
|
|
>callback : Symbol(callback, Decl(promiseIdentity.ts, 14, 15))
|
|
>x : Symbol(x, Decl(promiseIdentity.ts, 14, 26))
|
|
>V : Symbol(V, Decl(promiseIdentity.ts, 13, 21))
|
|
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
|
|
>U : Symbol(U, Decl(promiseIdentity.ts, 14, 9))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
|
|
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
|
|
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
|
|
>W : Symbol(W, Decl(promiseIdentity.ts, 14, 11))
|
|
}
|
|
|
|
// Ok because T in this particular Promise2 is any, as are all the U and W references.
|
|
// Also, the V of Promise2 happens to coincide with the T of IPromise2 (they are both string).
|
|
var y: IPromise2<string, number>;
|
|
>y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3))
|
|
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
|
|
|
|
var y: Promise2<any, string>;
|
|
>y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3))
|
|
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
|
|
|