2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers.ts ===
|
|
|
|
// indexers should behave like other members when merging interface declarations
|
|
|
|
|
|
|
|
interface A {
|
2015-04-13 23:01:57 +02:00
|
|
|
>A : A, Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: number]: string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 3, 5))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface A {
|
2015-04-13 23:01:57 +02:00
|
|
|
>A : A, Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: string]: { length: number };
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : string, Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 8, 5))
|
|
|
|
>length : number, Symbol(length, Decl(mergedInterfacesWithIndexers.ts, 8, 18))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var a: A;
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : A, Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
|
|
|
>A : A, Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r = a[1];
|
2015-04-13 23:01:57 +02:00
|
|
|
>r : string, Symbol(r, Decl(mergedInterfacesWithIndexers.ts, 12, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>a[1] : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : A, Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r2 = a['1'];
|
2015-04-13 23:01:57 +02:00
|
|
|
>r2 : { length: number; }, Symbol(r2, Decl(mergedInterfacesWithIndexers.ts, 13, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>a['1'] : { length: number; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : A, Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>'1' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r3 = a['hi'];
|
2015-04-13 23:01:57 +02:00
|
|
|
>r3 : { length: number; }, Symbol(r3, Decl(mergedInterfacesWithIndexers.ts, 14, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>a['hi'] : { length: number; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : A, Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>'hi' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|