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

Only include unique symbols when getting index types for access checks #23145

Merged
merged 3 commits into from
Apr 5, 2018

Conversation

weswigham
Copy link
Member

Alternative to #23090 that moves towards the indexof type we talked about the other day, but is lightweight enough to be more acceptable as a patch. Note that this only removes/fixes symbols - number literals from late bound symbols will still be an issue (though they've been an issue for longer and need to have more confusing behavior, so probably should wait for the full indexof implementation).

Copy link
Member

@ahejlsberg ahejlsberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the suggested change.

}
else {
return getUnionType(filter(originalKeys, isTypeString));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one line!

@mhegazy
Copy link
Contributor

mhegazy commented Apr 5, 2018

@weswigham please port to release-2.8 as well.

@weswigham weswigham merged commit de669cf into microsoft:master Apr 5, 2018
@weswigham weswigham deleted the remove-symbols-from-keyof branch April 5, 2018 17:59
weswigham added a commit to weswigham/TypeScript that referenced this pull request Apr 5, 2018
microsoft#23145)

* Only include unique symbols when getting index types for access checks

* Filter all nonstrings

* Inline ternary
@mhegazy mhegazy added this to the TypeScript 2.8.2 milestone Apr 5, 2018
weswigham added a commit that referenced this pull request Apr 5, 2018
#23145) (#23175)

* Only include unique symbols when getting index types for access checks

* Filter all nonstrings

* Inline ternary
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 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