39 lines
606 B
Plaintext
39 lines
606 B
Plaintext
|
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers.ts ===
|
||
|
// indexers should behave like other members when merging interface declarations
|
||
|
|
||
|
interface A {
|
||
|
>A : A
|
||
|
|
||
|
[x: number]: string;
|
||
|
>x : number
|
||
|
}
|
||
|
|
||
|
|
||
|
interface A {
|
||
|
>A : A
|
||
|
|
||
|
[x: string]: { length: number };
|
||
|
>x : string
|
||
|
>length : number
|
||
|
}
|
||
|
|
||
|
var a: A;
|
||
|
>a : A
|
||
|
>A : A
|
||
|
|
||
|
var r = a[1];
|
||
|
>r : string
|
||
|
>a[1] : string
|
||
|
>a : A
|
||
|
|
||
|
var r2 = a['1'];
|
||
|
>r2 : { length: number; }
|
||
|
>a['1'] : { length: number; }
|
||
|
>a : A
|
||
|
|
||
|
var r3 = a['hi'];
|
||
|
>r3 : { length: number; }
|
||
|
>a['hi'] : { length: number; }
|
||
|
>a : A
|
||
|
|