Skip to content

Middle operand in comma operator list not properly checked for side-effect-freeness #33646

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

Open
RyanCavanaugh opened this issue Sep 27, 2019 · 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@RyanCavanaugh
Copy link
Member

TypeScript Version: master at f304b81fa54285f
Search Terms: comma side effects

Code

declare const obj: any;
console.log(`${JSON.stringify(obj), undefined, 2}`);

Expected behavior: error TS2695: Left side of comma operator is unused and has no side effects.

Actual behavior: No errors

Playground Link: http://www.typescriptlang.org/play/#code/CYUwxgNghgTiAEYD2A7AzgF3kgRgKwC54oUBPAbgChl0kIQA6CJAcwAoADAEgG8ApAMoB5AHINMMAJYoWkgGak2uPAEoANPACuKUHOkhgGgEwBfDiqpA

Related Issues:
#10814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant