=== tests/cases/compiler/promiseIdentity.ts === interface IPromise { >IPromise : IPromise >T : T then(callback: (x: T) => IPromise): IPromise; >then : (callback: (x: T) => IPromise) => IPromise >U : U >callback : (x: T) => IPromise >x : T >T : T >IPromise : IPromise >U : U >IPromise : IPromise >U : U } interface Promise { >Promise : Promise >T : T then(callback: (x: T) => Promise): Promise; >then : (callback: (x: T) => Promise) => Promise >U : U >callback : (x: T) => Promise >x : T >T : T >Promise : Promise >U : U >Promise : Promise >U : U } var x: IPromise; >x : IPromise >IPromise : IPromise var x: Promise; >x : IPromise >Promise : Promise interface IPromise2 { >IPromise2 : IPromise2 >T : T >V : V then(callback: (x: T) => IPromise2): IPromise2; >then : (callback: (x: T) => IPromise2) => IPromise2 >U : U >W : W >callback : (x: T) => IPromise2 >x : T >T : T >IPromise2 : IPromise2 >U : U >W : W >IPromise2 : IPromise2 >W : W >U : U } interface Promise2 { >Promise2 : Promise2 >T : T >V : V then(callback: (x: V) => Promise2): Promise2; // Uses V instead of T in callback's parameter >then : (callback: (x: V) => Promise2) => Promise2 >U : U >W : W >callback : (x: V) => Promise2 >x : V >V : V >Promise2 : Promise2 >U : U >T : T >Promise2 : Promise2 >T : T >W : W } // 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 : IPromise2 >IPromise2 : IPromise2 var y: Promise2; >y : IPromise2 >Promise2 : Promise2