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

20 lines
443 B
TypeScript
Raw Normal View History

// @target: esnext
// @useDefineForClassFields: false
interface Mup<K, V> {
readonly size: number;
}
interface MupConstructor {
new(): Mup<any, any>;
new<K, V>(entries?: readonly (readonly [K, V])[] | null): Mup<K, V>;
readonly prototype: Mup<any, any>;
}
declare var Mup: MupConstructor;
class Sizz extends Mup {
// ok, because Mup is an interface
get size() { return 0 }
}
class Kasizz extends Mup {
size = -1
}