//// [promiseIdentityWithConstraints.ts] interface IPromise { then(callback: (x: T) => IPromise): IPromise; } interface Promise { then(callback: (x: T) => Promise): Promise; } // Error because constraint V doesn't match var x: IPromise; var x: Promise; //// [promiseIdentityWithConstraints.js] // Error because constraint V doesn't match var x; var x;