Skip to content

Minor fixes for 'keyof T' and indexed acces types #12389

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

Merged
merged 3 commits into from
Nov 20, 2016
Merged

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Nov 19, 2016

This PR implements the following minor changes:

  • Make a keyof T comparable to type string and type number.
  • Treat a keyof T as string | number when it is used to index a non-generic type.
  • Allow the object in a for-in statement or in operator to be of an indexed access type.

Treat keyof T as string | number for purposes of indexing
Allow indexed access types with for-in and in operator
@ahejlsberg ahejlsberg merged commit 998246a into master Nov 20, 2016
@ahejlsberg ahejlsberg deleted the keyofRelations branch November 20, 2016 23:54
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants