TypeScript/tests/cases/compiler/hidingIndexSignatures.ts
2014-07-12 17:30:19 -07:00

12 lines
223 B
TypeScript

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 {}