Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Introduce introspecing fast path for keyof intersection distribution#23986

Closed
weswigham wants to merge 2 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:fix-oomweswigham/TypeScript:fix-oomCopy head branch name to clipboard
Closed

Introduce introspecing fast path for keyof intersection distribution#23986
weswigham wants to merge 2 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:fix-oomweswigham/TypeScript:fix-oomCopy head branch name to clipboard

Conversation

@weswigham

@weswigham weswigham commented May 9, 2018

Copy link
Copy Markdown
Member

Fixes #23977

This does fix the OOM crash, however right now the fast-path logic just gives up if there's a non-literal type present; handling string and symbol gracefully without giving up on the fastpath is maybe worth doing.

@weswigham weswigham requested review from ahejlsberg and mhegazy May 9, 2018 00:18
…preserve input union if no filtering is actually performed
@weswigham

Copy link
Copy Markdown
Member Author

cc @ahejlsberg since you got assigned to this issue a minute before I opened this PR.

@ahejlsberg

Copy link
Copy Markdown
Member

I've just put up #24137 which performs a similar optimization but in the main path of intersection type creation.

@weswigham weswigham closed this May 17, 2018
@weswigham weswigham deleted the fix-oom branch May 17, 2018 21:05
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 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.

indexing with T extends keyof <Large Union> causes OOM

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.