swc/crates/swc_ecma_parser/tests/tsc/assignFromNumberInterface2.ts

27 lines
427 B
TypeScript

interface Number {
doStuff(): string;
}
interface NotNumber {
toString(radix?: number): string;
toFixed(fractionDigits?: number): string;
toExponential(fractionDigits?: number): string;
toPrecision(precision?: number): string;
valueOf(): number;
doStuff(): string;
}
var x = 1;
var a: Number;
var b: NotNumber;
a = x;
a = b;
b = a;
b = x;
x = a; // expected error
x = b; // expected error