TypeScript/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types
2015-04-13 14:29:37 -07:00

50 lines
1.8 KiB
Plaintext

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