30 lines
601 B
Text
30 lines
601 B
Text
|
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3.ts ===
|
||
|
interface I {
|
||
|
>I : I
|
||
|
|
||
|
[s: string]: (x: string) => number;
|
||
|
>s : string
|
||
|
>x : string
|
||
|
}
|
||
|
|
||
|
var o: I = {
|
||
|
>o : I
|
||
|
>I : I
|
||
|
>{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: string]: undefined; }
|
||
|
|
||
|
[+"foo"](y) { return y.length; },
|
||
|
>+"foo" : number
|
||
|
>y : string
|
||
|
>y.length : number
|
||
|
>y : string
|
||
|
>length : number
|
||
|
|
||
|
[+"bar"]: y => y.length
|
||
|
>+"bar" : number
|
||
|
>y => y.length : (y: string) => number
|
||
|
>y : string
|
||
|
>y.length : number
|
||
|
>y : string
|
||
|
>length : number
|
||
|
}
|