29 lines
1.6 KiB
Text
29 lines
1.6 KiB
Text
=== tests/cases/compiler/genericWithIndexerOfTypeParameterType1.ts ===
|
|
class LazyArray<T> {
|
|
>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
|
|
>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16))
|
|
|
|
private objects = <{ [objectId: string]: T; }>{};
|
|
>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
|
|
>objectId : Symbol(objectId, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 26))
|
|
>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16))
|
|
|
|
array() {
|
|
>array : Symbol(array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
|
|
|
|
return this.objects;
|
|
>this.objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
|
|
>this : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
|
|
>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
|
|
}
|
|
}
|
|
var lazyArray = new LazyArray<string>();
|
|
>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3))
|
|
>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
|
|
|
|
var value: string = lazyArray.array()["test"]; // used to be an error
|
|
>value : Symbol(value, Decl(genericWithIndexerOfTypeParameterType1.ts, 7, 3))
|
|
>lazyArray.array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
|
|
>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3))
|
|
>array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
|
|
|