TypeScript/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types

31 lines
1.4 KiB
Text

=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES6.ts ===
interface I {
>I : I, Symbol(I,Decl(computedPropertyNamesContextualType3_ES6.ts,0,0))
[s: string]: (x: string) => number;
>s : string, Symbol(s,Decl(computedPropertyNamesContextualType3_ES6.ts,1,5))
>x : string, Symbol(x,Decl(computedPropertyNamesContextualType3_ES6.ts,1,18))
}
var o: I = {
>o : I, Symbol(o,Decl(computedPropertyNamesContextualType3_ES6.ts,4,3))
>I : I, Symbol(I,Decl(computedPropertyNamesContextualType3_ES6.ts,0,0))
>{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: string]: (y: string) => number; }
[+"foo"](y) { return y.length; },
>+"foo" : number
>"foo" : string
>y : string, Symbol(y,Decl(computedPropertyNamesContextualType3_ES6.ts,5,13))
>y.length : number, Symbol(String.length,Decl(lib.d.ts,414,19))
>y : string, Symbol(y,Decl(computedPropertyNamesContextualType3_ES6.ts,5,13))
>length : number, Symbol(String.length,Decl(lib.d.ts,414,19))
[+"bar"]: y => y.length
>+"bar" : number
>"bar" : string
>y => y.length : (y: string) => number
>y : string, Symbol(y,Decl(computedPropertyNamesContextualType3_ES6.ts,6,13))
>y.length : number, Symbol(String.length,Decl(lib.d.ts,414,19))
>y : string, Symbol(y,Decl(computedPropertyNamesContextualType3_ES6.ts,6,13))
>length : number, Symbol(String.length,Decl(lib.d.ts,414,19))
}