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