mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
35 lines
798 B
TypeScript
35 lines
798 B
TypeScript
//// [tests/cases/conformance/classes/propertyMemberDeclarations/overrideInterfaceProperty.ts] ////
|
|
|
|
//// [overrideInterfaceProperty.ts]
|
|
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
|
|
}
|
|
|
|
|
|
//// [overrideInterfaceProperty.js]
|
|
"use strict";
|
|
class Sizz extends Mup {
|
|
// ok, because Mup is an interface
|
|
get size() { return 0; }
|
|
}
|
|
class Kasizz extends Mup {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.size = -1;
|
|
}
|
|
}
|