TypeScript/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types

50 lines
1.8 KiB
Text
Raw Normal View History

=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts ===
interface I<T> {
>I : I<T>, Symbol(I,Decl(computedPropertyNamesContextualType6_ES5.ts,0,0))
>T : T, Symbol(T,Decl(computedPropertyNamesContextualType6_ES5.ts,0,12))
[s: string]: T;
>s : string, Symbol(s,Decl(computedPropertyNamesContextualType6_ES5.ts,1,5))
>T : T, Symbol(T,Decl(computedPropertyNamesContextualType6_ES5.ts,0,12))
}
declare function foo<T>(obj: I<T>): T
>foo : <T>(obj: I<T>) => T, Symbol(foo,Decl(computedPropertyNamesContextualType6_ES5.ts,2,1))
>T : T, Symbol(T,Decl(computedPropertyNamesContextualType6_ES5.ts,4,21))
>obj : I<T>, Symbol(obj,Decl(computedPropertyNamesContextualType6_ES5.ts,4,24))
>I : I<T>, Symbol(I,Decl(computedPropertyNamesContextualType6_ES5.ts,0,0))
>T : T, Symbol(T,Decl(computedPropertyNamesContextualType6_ES5.ts,4,21))
>T : T, Symbol(T,Decl(computedPropertyNamesContextualType6_ES5.ts,4,21))
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | number[] | (() => void)
>foo : <T>(obj: I<T>) => T, Symbol(foo,Decl(computedPropertyNamesContextualType6_ES5.ts,2,1))
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | number[] | (() => void); 0: () => void; p: string; }
p: "",
>p : string, Symbol(p,Decl(computedPropertyNamesContextualType6_ES5.ts,6,5))
2015-04-13 21:36:11 +02:00
>"" : string
0: () => { },
>() => { } : () => void
["hi" + "bye"]: true,
>"hi" + "bye" : string
2015-04-13 21:36:11 +02:00
>"hi" : string
>"bye" : string
>true : boolean
[0 + 1]: 0,
>0 + 1 : number
2015-04-13 21:36:11 +02:00
>0 : number
>1 : number
>0 : number
[+"hi"]: [0]
>+"hi" : number
2015-04-13 21:36:11 +02:00
>"hi" : string
>[0] : number[]
2015-04-13 21:36:11 +02:00
>0 : number
});