31 lines
888 B
Plaintext
31 lines
888 B
Plaintext
=== 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))
|
|
|