Skip to content

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

@RyanCavanaugh

Description

@RyanCavanaugh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions