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

Allow indirect calls #51989

Merged
merged 2 commits into from
Jan 9, 2023
Merged

Allow indirect calls #51989

merged 2 commits into from
Jan 9, 2023

Conversation

shicks
Copy link
Contributor

@shicks shicks commented Dec 21, 2022

This is revived from #35878 ("No error on indirect calls"), which stalled out and was closed earlier this year as stale.

Fixes: #35866.

Per @RyanCavanaugh's comment on duplicate issue #48163, I've changed the check to explicitly require 0, rather than arbitrary expressions on the left of the comma. To address the unresponded comment on the earlier PR, I left the check for either an access expression or exactly eval for the RHS, since these are the only two cases where an indirect call is actually different from a direct call (to my knowledge).

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 21, 2022
@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue #35866. If you can get it accepted, this PR will have a better chance of being reviewed.

@shicks
Copy link
Contributor Author

shicks commented Dec 21, 2022

It's possible that restricting the LHS to only allow exactly 0, could break existing uses of indirect eval. Is that something we're concerned about? I could partially (for eval only) or entirely lift that restriction if necessary.

@shicks
Copy link
Contributor Author

shicks commented Dec 22, 2022

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

(0, object.property)() produces TS2695
5 participants