41 lines
650 B
Text
41 lines
650 B
Text
=== 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
|
|
>1 : number
|
|
|
|
var r2 = a['1'];
|
|
>r2 : { length: number; }
|
|
>a['1'] : { length: number; }
|
|
>a : A
|
|
>'1' : string
|
|
|
|
var r3 = a['hi'];
|
|
>r3 : { length: number; }
|
|
>a['hi'] : { length: number; }
|
|
>a : A
|
|
>'hi' : string
|
|
|