Skip to content

Better errors for indexing gettable/settable values #26098

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

@sandersn found a case where, upon turning on noImplicitAny in Puppeteer, we issued the following error on a Map:

Element implicitly has an 'any' type because type 'Map<string, Function>' has no index signature.

We should give a more specialized error message in cases where there is no index signature, but the value has a method get that takes a string, or when

Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions