TypeScript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES6.ts

9 lines
161 B
TypeScript

// @target: es6
interface I {
[s: string]: (x: string) => number;
}
var o: I = {
[+"foo"](y) { return y.length; },
[+"bar"]: y => y.length
}