35 lines
1.3 KiB
Text
35 lines
1.3 KiB
Text
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers.ts ===
|
|
// indexers should behave like other members when merging interface declarations
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
|
|
|
[x: number]: string;
|
|
>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 3, 5))
|
|
}
|
|
|
|
|
|
interface A {
|
|
>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
|
|
|
[x: string]: { length: number };
|
|
>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 8, 5))
|
|
>length : Symbol(length, Decl(mergedInterfacesWithIndexers.ts, 8, 18))
|
|
}
|
|
|
|
var a: A;
|
|
>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
|
>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
|
|
|
var r = a[1];
|
|
>r : Symbol(r, Decl(mergedInterfacesWithIndexers.ts, 12, 3))
|
|
>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
|
|
|
var r2 = a['1'];
|
|
>r2 : Symbol(r2, Decl(mergedInterfacesWithIndexers.ts, 13, 3))
|
|
>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
|
|
|
var r3 = a['hi'];
|
|
>r3 : Symbol(r3, Decl(mergedInterfacesWithIndexers.ts, 14, 3))
|
|
>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
|
|