34 lines
448 B
Text
34 lines
448 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
|
|
>"" : string
|
|
|
|
var a: A;
|
|
>a : A
|
|
>A : A
|
|
|
|
a[""]; // Should be {}
|
|
>a[""] : {}
|
|
>a : A
|
|
>"" : string
|
|
|