microsoft / microsoft/TypeScript
Middle operand in comma operator list not properly checked for side-effect-freeness
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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
Related Issues:
#10814
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the TypeScript version of the issue with the provided comma-expression example, then trace the compiler's side-effect checking for the middle operand. Compare the behavior with related issue #10814. Done means the example reports TS2695 for the unused, side-effect-free operand without introducing errors for valid comma expressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100