Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intersection types are not valid index signature types #5599

Closed
weswigham opened this issue Nov 10, 2015 · 1 comment
Closed

Intersection types are not valid index signature types #5599

weswigham opened this issue Nov 10, 2015 · 1 comment
Labels
Committed The team has roadmapped this issue Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@weswigham
Copy link
Member

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.

@ivogabe
Copy link
Contributor

ivogabe commented Nov 11, 2015

Looks like a duplicate of #4372

@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels Nov 11, 2015
@RyanCavanaugh RyanCavanaugh added Fixed A PR has been merged for this issue Committed The team has roadmapped this issue and removed In Discussion Not yet reached consensus labels Feb 9, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Feb 11, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Committed The team has roadmapped this issue Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants