镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Unless checking accesses, do not include unique symbols or numbers in index types - #23090

Closed
Wesley Wigham (weswigham) wants to merge 1 commit into
microsoft:masterfrom
weswigham:filtermap-keyof-instantiate
Closed

Wesley Wigham (weswigham) wants to merge 1 commit into
microsoft:masterfrom
weswigham:filtermap-keyof-instantiate

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes the issue of keyof now returning unique symbols that Kevin Donnelly (@kpdonn) reported in #20721, and Anders Hejlsberg (@ahejlsberg) were you looking at another issue this fixed?

Regarding the implementation - I actually had to add a new relationship (ew) to handle comparing with constraints of generic index types. (To continue to allow, eg, T[typeof sym]).

@weswigham Wesley Wigham (weswigham) changed the title Unless checking access, do not include unqie symbols or numbers in index types Unless checking accesses, do not include unique symbols or numbers in index types Apr 2, 2018
@kpdonn

Copy link
Copy Markdown
Contributor

FWIW I actually think it makes a lot of sense for keyof to include unique symbol. See #20721 for my reasoning, but I was only pointing it out because it seemed pretty clearly unintentional and not because I thought it was actually a problem.

If it made it through a release with nobody complaining maybe it's a sign it was a good change? 🤷‍♂️

@weswigham

Copy link
Copy Markdown
Member Author

Kevin Donnelly (@kpdonn) keyof T can produce symbols, but keyof T is assignable to string - that's a bit of a pickle.

@weswigham

Copy link
Copy Markdown
Member Author

Closed in favor of #23145.

@weswigham
Wesley Wigham (weswigham) deleted the filtermap-keyof-instantiate branch April 11, 2018 23:08
@microsoft 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.

2 participants