TypeScript/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types

36 lines
2.1 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/genericWithIndexerOfTypeParameterType1.ts ===
class LazyArray<T> {
2015-04-13 23:01:57 +02:00
>LazyArray : LazyArray<T>, Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
>T : T, Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16))
2014-08-15 23:33:16 +02:00
private objects = <{ [objectId: string]: T; }>{};
2015-04-13 23:01:57 +02:00
>objects : { [objectId: string]: T; }, Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
><{ [objectId: string]: T; }>{} : { [objectId: string]: T; }
2015-04-13 23:01:57 +02:00
>objectId : string, Symbol(objectId, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 26))
>T : T, Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16))
2014-10-13 15:56:58 +02:00
>{} : { [x: string]: undefined; }
2014-08-15 23:33:16 +02:00
array() {
2015-04-13 23:01:57 +02:00
>array : () => { [objectId: string]: T; }, Symbol(array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
2014-08-15 23:33:16 +02:00
return this.objects;
2015-04-13 23:01:57 +02:00
>this.objects : { [objectId: string]: T; }, Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
>this : LazyArray<T>, Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
>objects : { [objectId: string]: T; }, Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20))
2014-08-15 23:33:16 +02:00
}
}
var lazyArray = new LazyArray<string>();
2015-04-13 23:01:57 +02:00
>lazyArray : LazyArray<string>, Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>new LazyArray<string>() : LazyArray<string>
2015-04-13 23:01:57 +02:00
>LazyArray : typeof LazyArray, Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var value: string = lazyArray.array()["test"]; // used to be an error
2015-04-13 23:01:57 +02:00
>value : string, Symbol(value, Decl(genericWithIndexerOfTypeParameterType1.ts, 7, 3))
2014-08-15 23:33:16 +02:00
>lazyArray.array()["test"] : string
>lazyArray.array() : { [objectId: string]: string; }
2015-04-13 23:01:57 +02:00
>lazyArray.array : () => { [objectId: string]: string; }, Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
>lazyArray : LazyArray<string>, Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3))
>array : () => { [objectId: string]: string; }, Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53))
2015-04-13 21:36:11 +02:00
>"test" : string
2014-08-15 23:33:16 +02:00