TypeScript/tests/cases/compiler/genericWithIndexerOfTypeParameterType1.ts

8 lines
243 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
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