-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
TypeScript/src/lib/es2019.object.d.ts
Line 8 in d2516fa
fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T }; |
const record = Object.fromEntries([[Symbol.for("1"), "hi"]]);
console.log(record[Symbol.for("1")]);
error: TS2538 [ERROR]: Type 'symbol' cannot be used as an index type.
console.log(record[Symbol.for("1")]);
~~~~~~~~~~~~~~~
the return type should account for objects built with symbols for keys (e.g. through a generic type or something)
MartinJohns
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created