Skip to content

Intersection types are not valid index signature types #5599

Description

@weswigham

For example, a variable of type

type Path = string & { __pathBrand: any };

cannot be used as an indexer type, and cannot be used to index an object with a string type indexer (despite being safely usable as a string in all other locations).

If an intersection type contains types which are valid for use in an index signature, then the intersection type itself should probably be valid as an index signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions