TypeScript/tests/cases/compiler/indexSignatureTypeCheck.ts

18 lines
274 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
interface IPropertySet {
[index: string]: any;
}
var ps: IPropertySet = null;
var index: any = "hello";
ps[index] = 12;
interface indexErrors {
[p2?: string];
[...p3: any[]];
[p4: string, p5?: string];
[p6: string, ...p7: any[]];
}