TypeScript/tests/cases/conformance/types/thisType/unionThisTypeInFunctions.ts
Andrew Branch 3d09010dc8
Intersect 'this' types in union signatures (#32538)
* Intersect this types in union signatures

* Actually update baselines
2019-07-26 14:56:03 -07:00

12 lines
228 B
TypeScript

interface Real {
method(this: this, n: number): void;
data: string;
}
interface Fake {
method(this: this, n: number): void;
data: number;
}
function test(r: Real | Fake) {
r.method(12); // error
}