GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Object.fromEntries: return type does not account for symbols · Issue #44405 · microsoft/TypeScript

Object.fromEntries: return type does not account for symbols #44405

New issue
Copy link
New issue
Copy link
Closed
Closed
Object.fromEntries: return type does not account for symbols#44405
Copy link
Labels
DuplicateAn existing issue was already createdAn existing issue was already created

Description

@mfulton26
Mark Fulton (mfulton26)
opened on Jun 3, 2021
Issue body actions

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)

Reacted by Martin Johns

Activity

  1. jcalz commented on Jun 3, 2021

    @jcalz
    Joe Calzaretta (jcalz)
    on Jun 3, 2021
    Contributor
    More actions

    There's a whole template you're supposed to fill out when you file a bug here, to help the TS team triage and respond.

    Anyway I don't think much can be done here until something like #35909 and #26797 are dealt with. Also relevant: #37457, with the comment: "Symbols are still dropped on the floor, just like the rest of the compiler."

  2. mfulton26 commented on Jun 4, 2021

    @mfulton26
    Mark Fulton (mfulton26)
    on Jun 4, 2021
    ContributorAuthor
    More actions

    Weird, I was never prompted with a template. Maybe that is because I made the issue from clicking the referenced line of code...

    Reacted by Joe Calzaretta
  3. Ryan Cavanaugh (RyanCavanaugh)
    added
    DuplicateAn existing issue was already createdAn existing issue was already created
    on Jun 10, 2021
  4. TypeScript Bot (typescript-bot)
    closed this as completedon Jun 13, 2021
  5. typescript-bot commented on Jun 13, 2021

    @typescript-bot
    TypeScript Bot (typescript-bot)
    on Jun 13, 2021
    Contributor
    More actions

    This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

  6. microsoft
    locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.