35 lines
613 B
Plaintext
35 lines
613 B
Plaintext
=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesIndexersWithAssignmentCompatibility.ts ===
|
|
class Base {
|
|
>Base : Base
|
|
|
|
[x: string]: Object;
|
|
>x : string
|
|
>Object : Object
|
|
}
|
|
|
|
// ok, use assignment compatibility
|
|
class Derived extends Base {
|
|
>Derived : Derived
|
|
>Base : Base
|
|
|
|
[x: string]: any;
|
|
>x : string
|
|
}
|
|
|
|
class Base2 {
|
|
>Base2 : Base2
|
|
|
|
[x: number]: Object;
|
|
>x : number
|
|
>Object : Object
|
|
}
|
|
|
|
// ok, use assignment compatibility
|
|
class Derived2 extends Base2 {
|
|
>Derived2 : Derived2
|
|
>Base2 : Base2
|
|
|
|
[x: number]: any;
|
|
>x : number
|
|
}
|