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

8 lines
243 B
TypeScript

class LazyArray<T> {
private objects = <{ [objectId: string]: T; }>{};
array() {
return this.objects;
}
}
var lazyArray = new LazyArray<string>();
var value: string = lazyArray.array()["test"]; // used to be an error