=== tests/cases/compiler/promiseIdentity.ts === interface IPromise { >IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0)) >T : Symbol(T, Decl(promiseIdentity.ts, 0, 19)) then(callback: (x: T) => IPromise): IPromise; >then : Symbol(then, Decl(promiseIdentity.ts, 0, 23)) >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, 19)) >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 { >Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1)) >T : Symbol(T, Decl(promiseIdentity.ts, 3, 18)) then(callback: (x: T) => Promise): Promise; >then : Symbol(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; >x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3)) >IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0)) var x: Promise; >x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3)) >Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1)) interface IPromise2 { >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(callback: (x: T) => IPromise2): IPromise2; >then : Symbol(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 { >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(callback: (x: V) => Promise2): Promise2; // Uses V instead of T in callback's parameter >then : Symbol(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; >y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3)) >IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23)) var y: Promise2; >y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3)) >Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))