TypeScript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES6.ts
Nathan Shively-Sanders 42c17e194e Address PR comments
2016-05-25 17:03:33 -07:00

20 lines
293 B
TypeScript

// @target: es6
interface I<T> {
[n: number]: T;
}
interface J<T> {
[s: string]: T;
}
declare function foo<T>(obj: I<T>): T;
declare function g<T>(obj: J<T>): T;
foo({
0: () => { },
["hi" + "bye"]: true,
[0 + 1]: 0,
[+"hi"]: [0]
});
g({ p: "" });