19 lines
350 B
TypeScript
19 lines
350 B
TypeScript
//// [hidingIndexSignatures.ts]
|
|
interface A {
|
|
[a: string]: {};
|
|
}
|
|
|
|
interface B extends A {
|
|
[a: string]: number; // Number is not a subtype of string. Should error.
|
|
}
|
|
|
|
var b: B;
|
|
b[""]; // Should be number
|
|
var a: A;
|
|
a[""]; // Should be {}
|
|
|
|
//// [hidingIndexSignatures.js]
|
|
var b;
|
|
b[""]; // Should be number
|
|
var a;
|
|
a[""]; // Should be {}
|