TypeScript/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types

36 lines
1.7 KiB
Plaintext
Raw Normal View History

=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts ===
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0))
[s: string]: (x: any) => number; // Doesn't get hit
2015-04-13 23:01:57 +02:00
>s : string, Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 5))
>x : any, Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 18))
[s: number]: (x: string) => number;
2015-04-13 23:01:57 +02:00
>s : number, Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 5))
>x : string, Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 18))
}
var o: I = {
2015-04-13 23:01:57 +02:00
>o : I, Symbol(o, Decl(computedPropertyNamesContextualType2_ES5.ts, 5, 3))
>I : I, Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0))
>{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: string]: (y: string) => number; [x: number]: (y: string) => number; }
[+"foo"](y) { return y.length; },
>+"foo" : number
2015-04-13 21:36:11 +02:00
>"foo" : string
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13))
>y.length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
>y : string, Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13))
>length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
[+"bar"]: y => y.length
>+"bar" : number
2015-04-13 21:36:11 +02:00
>"bar" : string
>y => y.length : (y: string) => number
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13))
>y.length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
>y : string, Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13))
>length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
}