TypeScript/tests/cases/conformance/types/thisType/unionThisTypeInFunctions.ts

12 lines
219 B
TypeScript
Raw Normal View History

interface Real {
2016-03-25 23:41:37 +01:00
method(this: this, n: number): void;
data: string;
}
interface Fake {
2016-03-25 23:41:37 +01:00
method(this: this, n: number): void;
data: number;
}
function test(r: Real | Fake) {
r.method(12);
}