35 lines
769 B
Text
35 lines
769 B
Text
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts ===
|
|
interface I {
|
|
>I : I
|
|
|
|
[s: string]: (x: any) => number; // Doesn't get hit
|
|
>s : string
|
|
>x : any
|
|
|
|
[s: number]: (x: string) => number;
|
|
>s : number
|
|
>x : string
|
|
}
|
|
|
|
var o: I = {
|
|
>o : I
|
|
>I : I
|
|
>{ [+"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
|
|
>"foo" : string
|
|
>y : string
|
|
>y.length : number
|
|
>y : string
|
|
>length : number
|
|
|
|
[+"bar"]: y => y.length
|
|
>+"bar" : number
|
|
>"bar" : string
|
|
>y => y.length : (y: string) => number
|
|
>y : string
|
|
>y.length : number
|
|
>y : string
|
|
>length : number
|
|
}
|