==== tests/cases/compiler/promiseIdentityWithAny2.ts (2 errors) ==== interface IPromise { then(callback: (x: T) => IPromise): IPromise; } interface Promise { then(callback: (x: T) => Promise): Promise; } // Error because type parameter arity doesn't match var x: IPromise; var x: Promise; ~ !!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. interface IPromise2 { then(callback: (x: T) => IPromise2): IPromise2; } interface Promise2 { then(callback: (x: T) => Promise2): Promise2; // Uses string instead of any! } // Error because string and any don't match var y: IPromise2; var y: Promise2; ~ !!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'.