1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
=== tests/cases/compiler/hidingIndexSignatures.ts ===
interface A {
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))
[a: string]: {};
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 1, 5))
}
interface B extends A {
>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1))
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))
[a: string]: number; // Number is not a subtype of string. Should error.
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 5, 5))
}
var b: B;
>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3))
>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1))
b[""]; // Should be number
>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3))
var a: A;
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3))
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))
a[""]; // Should be {}
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3))
|