TypeScript/tests/baselines/reference/unionThisTypeInFunctions.js
2016-03-25 15:41:37 -07:00

19 lines
326 B
TypeScript

//// [unionThisTypeInFunctions.ts]
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);
}
//// [unionThisTypeInFunctions.js]
function test(r) {
r.method(12);
}