TypeScript/tests/cases/compiler/checkJsObjectLiteralIndexSignatures.ts
2018-08-06 11:52:51 -07:00

16 lines
271 B
TypeScript

// @allowJs: true
// @noImplicitAny: true
// @outDir: ./out
// @filename: file.js
// @ts-check
let n = Math.random();
let s = `${n}`;
const numericIndex = { [n]: 1 };
numericIndex[n].toFixed();
const stringIndex = { [s]: 1 };
stringIndex[s].toFixed();