TypeScript/tests/cases/conformance/types/thisType/unionThisTypeInFunctions.ts
2016-03-25 15:41:37 -07:00

12 lines
219 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);
}