// #22362 interface MyPromise { then(cb: (t: T) => void): void; thenUnion(cb: (t: T | U) => void): this; } interface DoNothingAlias extends MyPromise { } declare function shouldBeIdentity(p: DoNothingAlias): MyPromise; declare const p1: MyPromise; var p2 = shouldBeIdentity(p1); var p2: MyPromise;