export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } export interface Promise { then(callback: (x: T) => Promise): Promise; } // error because T is string in the first declaration, and T is boolean in the second // Return type and callback return type are ok because T is any in this particular Promise var x: IPromise; var x: Promise;