33 lines
420 B
Text
33 lines
420 B
Text
|
=== tests/cases/compiler/hidingIndexSignatures.ts ===
|
||
|
interface A {
|
||
|
>A : A
|
||
|
|
||
|
[a: string]: {};
|
||
|
>a : string
|
||
|
}
|
||
|
|
||
|
interface B extends A {
|
||
|
>B : B
|
||
|
>A : A
|
||
|
|
||
|
[a: string]: number; // Number is not a subtype of string. Should error.
|
||
|
>a : string
|
||
|
}
|
||
|
|
||
|
var b: B;
|
||
|
>b : B
|
||
|
>B : B
|
||
|
|
||
|
b[""]; // Should be number
|
||
|
>b[""] : number
|
||
|
>b : B
|
||
|
|
||
|
var a: A;
|
||
|
>a : A
|
||
|
>A : A
|
||
|
|
||
|
a[""]; // Should be {}
|
||
|
>a[""] : {}
|
||
|
>a : A
|
||
|
|